diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 23:41:46 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 23:41:46 +0000 |
commit | e6a9ca2eef73df9fefc2b79845d908af1a5aa7f2 (patch) | |
tree | efc8ae8028b7cb8c30158b6089d1fff0cee441e5 | |
parent | 145c7050df11191be3e14affeb1c6cb5d165f4d9 (diff) | |
download | chromium_src-e6a9ca2eef73df9fefc2b79845d908af1a5aa7f2.zip chromium_src-e6a9ca2eef73df9fefc2b79845d908af1a5aa7f2.tar.gz chromium_src-e6a9ca2eef73df9fefc2b79845d908af1a5aa7f2.tar.bz2 |
[Hotword] Disabling the extension on install should only occur if it was auto-installed.
BUG=364853
Review URL: https://codereview.chromium.org/243083003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264888 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/search/hotword_service.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc index b2db1de..ac25512 100644 --- a/chrome/browser/search/hotword_service.cc +++ b/chrome/browser/search/hotword_service.cc @@ -131,8 +131,10 @@ HotwordService::HotwordService(Profile* profile) enabled_state = DISABLED; } else { // If the preference has not been set the hotword extension should - // not be running. - DisableHotwordExtension(GetExtensionService(profile_)); + // not be running. However, this should only be done if auto-install + // is enabled which is gated through the IsHotwordAllowed check. + if (IsHotwordAllowed()) + DisableHotwordExtension(GetExtensionService(profile_)); } UMA_HISTOGRAM_ENUMERATION("Hotword.Enabled", enabled_state, NUM_HOTWORD_ENABLED_METRICS); @@ -165,7 +167,11 @@ void HotwordService::Observe(int type, const extensions::Extension* extension = content::Details<const extensions::InstalledExtensionInfo>(details) ->extension; - if (extension->id() == extension_misc::kHotwordExtensionId && + // Disabling the extension automatically on install should only occur + // if the user is in the field trial for auto-install which is gated + // by the IsHotwordAllowed check. + if (IsHotwordAllowed() && + extension->id() == extension_misc::kHotwordExtensionId && !profile_->GetPrefs()->GetBoolean(prefs::kHotwordSearchEnabled)) { DisableHotwordExtension(GetExtensionService(profile_)); // Once the extension is disabled, it will not be enabled until the |