Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 552298 | Differences between
and this patch

Collapse All | Expand All

(-)a/build/common.gypi (+4 lines)
Lines 416-421 Link Here
416
      # Web speech is enabled by default. Set to 0 to disable.
416
      # Web speech is enabled by default. Set to 0 to disable.
417
      'enable_web_speech%': 1,
417
      'enable_web_speech%': 1,
418
418
419
      # 'Ok Google' hotwording is enabled by default. Set to 0 to disable.
420
      'enable_hotwording%': 1,
421
419
      # Notifications are compiled in by default. Set to 0 to disable.
422
      # Notifications are compiled in by default. Set to 0 to disable.
420
      'notifications%' : 1,
423
      'notifications%' : 1,
421
424
Lines 1143-1148 Link Here
1143
    'configuration_policy%': '<(configuration_policy)',
1146
    'configuration_policy%': '<(configuration_policy)',
1144
    'safe_browsing%': '<(safe_browsing)',
1147
    'safe_browsing%': '<(safe_browsing)',
1145
    'enable_web_speech%': '<(enable_web_speech)',
1148
    'enable_web_speech%': '<(enable_web_speech)',
1149
    'enable_hotwording%': '<(enable_hotwording)',
1146
    'notifications%': '<(notifications)',
1150
    'notifications%': '<(notifications)',
1147
    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1151
    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1148
    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1152
    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
(-)a/chrome/browser/BUILD.gn (+9 lines)
Lines 19-24 if (is_desktop_linux) { Link Here
19
  import("//build/config/linux/pkg_config.gni")
19
  import("//build/config/linux/pkg_config.gni")
20
}
20
}
21
21
22
declare_args() {
23
  # 'Ok Google' hotwording is enabled.
24
  enable_hotwording = true
25
}
26
22
about_credits_file = "$target_gen_dir/about_credits.html"
27
about_credits_file = "$target_gen_dir/about_credits.html"
23
additional_modules_list_file =
28
additional_modules_list_file =
24
    "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
29
    "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
Lines 452-457 source_set("browser") { Link Here
452
    }
457
    }
453
  }
458
  }
454
459
460
  if (enable_hotwording) {
461
    defines += [ "ENABLE_HOTWORDING" ]
462
  }
463
455
  if (is_linux) {
464
  if (is_linux) {
456
    deps += [
465
    deps += [
457
      "//device/media_transfer_protocol",
466
      "//device/media_transfer_protocol",
(-)a/chrome/browser/search/hotword_service.cc (+4 lines)
Lines 639-645 bool HotwordService::IsServiceAvailable() { Link Here
639
}
639
}
640
640
641
bool HotwordService::IsHotwordAllowed() {
641
bool HotwordService::IsHotwordAllowed() {
642
#if defined(ENABLE_HOTWORDING)
642
  return DoesHotwordSupportLanguage(profile_);
643
  return DoesHotwordSupportLanguage(profile_);
644
#else
645
  return false;
646
#endif
643
}
647
}
644
648
645
bool HotwordService::IsOptedIntoAudioLogging() {
649
bool HotwordService::IsOptedIntoAudioLogging() {
(-)a/chrome/browser/search/hotword_service_unittest.cc (+4 lines)
Lines 157-162 INSTANTIATE_TEST_CASE_P(HotwordServiceTests, Link Here
157
                            extension_misc::kHotwordSharedModuleId));
157
                            extension_misc::kHotwordSharedModuleId));
158
158
159
TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
159
TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
160
#if defined(ENABLE_HOTWORDING)
160
  TestingProfile::Builder profile_builder;
161
  TestingProfile::Builder profile_builder;
161
  scoped_ptr<TestingProfile> profile = profile_builder.Build();
162
  scoped_ptr<TestingProfile> profile = profile_builder.Build();
162
163
Lines 187-192 TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) { Link Here
187
  Profile* otr_profile = profile->GetOffTheRecordProfile();
188
  Profile* otr_profile = profile->GetOffTheRecordProfile();
188
  SetApplicationLocale(otr_profile, "en");
189
  SetApplicationLocale(otr_profile, "en");
189
  EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(otr_profile));
190
  EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(otr_profile));
191
#endif  // defined(ENABLE_HOTWORDING)
190
}
192
}
191
193
192
TEST_P(HotwordServiceTest, ShouldReinstallExtension) {
194
TEST_P(HotwordServiceTest, ShouldReinstallExtension) {
Lines 243-248 TEST_P(HotwordServiceTest, PreviousLanguageSetOnInstall) { Link Here
243
}
245
}
244
246
245
TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
247
TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
248
#if defined(ENABLE_HOTWORDING)
246
  InitializeEmptyExtensionService();
249
  InitializeEmptyExtensionService();
247
  service_->Init();
250
  service_->Init();
248
251
Lines 313-318 TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) { Link Here
313
  EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
316
  EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
314
  EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
317
  EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
315
  EXPECT_EQ(1, hotword_service->uninstall_count());  // no change
318
  EXPECT_EQ(1, hotword_service->uninstall_count());  // no change
319
#endif  // defined(ENABLE_HOTWORDING)
316
}
320
}
317
321
318
TEST_P(HotwordServiceTest, DisableAlwaysOnOnLanguageChange) {
322
TEST_P(HotwordServiceTest, DisableAlwaysOnOnLanguageChange) {
(-)a/chrome/chrome_browser.gypi (-1 / +3 lines)
Lines 3589-3594 Link Here
3589
        ['enable_session_service==1', {
3589
        ['enable_session_service==1', {
3590
          'sources': [ '<@(chrome_browser_session_service_sources)' ],
3590
          'sources': [ '<@(chrome_browser_session_service_sources)' ],
3591
        }],
3591
        }],
3592
        ['enable_hotwording==1', {
3593
          'defines': [ 'ENABLE_HOTWORDING' ],
3594
        }],
3592
        ['OS!="android" and OS!="ios" and chromeos==0', {
3595
        ['OS!="android" and OS!="ios" and chromeos==0', {
3593
          'sources': [ '<@(chrome_browser_desktop_sources)' ],
3596
          'sources': [ '<@(chrome_browser_desktop_sources)' ],
3594
        }],
3597
        }],
3595
- 

Return to bug 552298