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 381-386 Link Here
381
      # Web speech is enabled by default. Set to 0 to disable.
381
      # Web speech is enabled by default. Set to 0 to disable.
382
      'enable_web_speech%': 1,
382
      'enable_web_speech%': 1,
383
383
384
      # 'Ok Google' hotwording is enabled by default. Set to 0 to disable.
385
      'enable_hotwording%': 1,
386
384
      # Notifications are compiled in by default. Set to 0 to disable.
387
      # Notifications are compiled in by default. Set to 0 to disable.
385
      'notifications%' : 1,
388
      'notifications%' : 1,
386
389
Lines 1134-1139 Link Here
1134
    'configuration_policy%': '<(configuration_policy)',
1137
    'configuration_policy%': '<(configuration_policy)',
1135
    'safe_browsing%': '<(safe_browsing)',
1138
    'safe_browsing%': '<(safe_browsing)',
1136
    'enable_web_speech%': '<(enable_web_speech)',
1139
    'enable_web_speech%': '<(enable_web_speech)',
1140
    'enable_hotwording%': '<(enable_hotwording)',
1137
    'notifications%': '<(notifications)',
1141
    'notifications%': '<(notifications)',
1138
    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1142
    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
1139
    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
1143
    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
(-)a/chrome/browser/BUILD.gn (+9 lines)
Lines 18-23 if (is_desktop_linux) { Link Here
18
  import("//build/config/linux/pkg_config.gni")
18
  import("//build/config/linux/pkg_config.gni")
19
}
19
}
20
20
21
declare_args() {
22
  # 'Ok Google' hotwording is enabled.
23
  enable_hotwording = true
24
}
25
21
about_credits_file = "$target_gen_dir/about_credits.html"
26
about_credits_file = "$target_gen_dir/about_credits.html"
22
additional_modules_list_file =
27
additional_modules_list_file =
23
    "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
28
    "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
Lines 455-460 source_set("browser") { Link Here
455
    }
460
    }
456
  }
461
  }
457
462
463
  if (enable_hotwording) {
464
    defines += [ "ENABLE_HOTWORDING" ]
465
  }
466
458
  if (is_linux) {
467
  if (is_linux) {
459
    deps += [
468
    deps += [
460
      "//device/media_transfer_protocol",
469
      "//device/media_transfer_protocol",
(-)a/chrome/browser/search/hotword_service.cc (+4 lines)
Lines 642-647 bool HotwordService::IsServiceAvailable() { Link Here
642
}
642
}
643
643
644
bool HotwordService::IsHotwordAllowed() {
644
bool HotwordService::IsHotwordAllowed() {
645
#if defined(ENABLE_HOTWORDING)
645
  std::string group = base::FieldTrialList::FindFullName(
646
  std::string group = base::FieldTrialList::FindFullName(
646
      hotword_internal::kHotwordFieldTrialName);
647
      hotword_internal::kHotwordFieldTrialName);
647
  // Allow hotwording by default, and only disable if the field trial has been
648
  // Allow hotwording by default, and only disable if the field trial has been
Lines 650-655 bool HotwordService::IsHotwordAllowed() { Link Here
650
    return false;
651
    return false;
651
652
652
  return DoesHotwordSupportLanguage(profile_);
653
  return DoesHotwordSupportLanguage(profile_);
654
#else
655
  return false;
656
#endif
653
}
657
}
654
658
655
bool HotwordService::IsOptedIntoAudioLogging() {
659
bool HotwordService::IsOptedIntoAudioLogging() {
(-)a/chrome/browser/search/hotword_service_unittest.cc (+4 lines)
Lines 216-221 TEST_P(HotwordServiceTest, IsHotwordAllowedInvalidFieldTrial) { Link Here
216
}
216
}
217
217
218
TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
218
TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
219
#if defined(ENABLE_HOTWORDING)
219
  TestingProfile::Builder profile_builder;
220
  TestingProfile::Builder profile_builder;
220
  scoped_ptr<TestingProfile> profile = profile_builder.Build();
221
  scoped_ptr<TestingProfile> profile = profile_builder.Build();
221
222
Lines 246-251 TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) { Link Here
246
  Profile* otr_profile = profile->GetOffTheRecordProfile();
247
  Profile* otr_profile = profile->GetOffTheRecordProfile();
247
  SetApplicationLocale(otr_profile, "en");
248
  SetApplicationLocale(otr_profile, "en");
248
  EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(otr_profile));
249
  EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(otr_profile));
250
#endif  // defined(ENABLE_HOTWORDING)
249
}
251
}
250
252
251
TEST_P(HotwordServiceTest, ShouldReinstallExtension) {
253
TEST_P(HotwordServiceTest, ShouldReinstallExtension) {
Lines 302-307 TEST_P(HotwordServiceTest, PreviousLanguageSetOnInstall) { Link Here
302
}
304
}
303
305
304
TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
306
TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
307
#if defined(ENABLE_HOTWORDING)
305
  InitializeEmptyExtensionService();
308
  InitializeEmptyExtensionService();
306
  service_->Init();
309
  service_->Init();
307
310
Lines 372-377 TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) { Link Here
372
  EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
375
  EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
373
  EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
376
  EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
374
  EXPECT_EQ(1, hotword_service->uninstall_count());  // no change
377
  EXPECT_EQ(1, hotword_service->uninstall_count());  // no change
378
#endif  // defined(ENABLE_HOTWORDING)
375
}
379
}
376
380
377
TEST_P(HotwordServiceTest, DisableAlwaysOnOnLanguageChange) {
381
TEST_P(HotwordServiceTest, DisableAlwaysOnOnLanguageChange) {
(-)a/chrome/chrome_browser.gypi (-1 / +3 lines)
Lines 3529-3534 Link Here
3529
        ['enable_session_service==1', {
3529
        ['enable_session_service==1', {
3530
          'sources': [ '<@(chrome_browser_session_service_sources)' ],
3530
          'sources': [ '<@(chrome_browser_session_service_sources)' ],
3531
        }],
3531
        }],
3532
        ['enable_hotwording==1', {
3533
          'defines': [ 'ENABLE_HOTWORDING' ],
3534
        }],
3532
        ['OS!="android" and OS!="ios" and chromeos==0', {
3535
        ['OS!="android" and OS!="ios" and chromeos==0', {
3533
          'sources': [ '<@(chrome_browser_desktop_sources)' ],
3536
          'sources': [ '<@(chrome_browser_desktop_sources)' ],
3534
        }],
3537
        }],
3535
- 

Return to bug 552298