Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Issue 330193005: [Hotword] Uninstall and reinstall the extension upon language change. (Closed)

Created:
6 years, 6 months ago by rpetterson
Modified:
6 years, 6 months ago
Reviewers:
Yoyo Zhou, Jered
CC:
chromium-reviews, extensions-reviews_chromium.org, skanuj+watch_chromium.org, melevin+watch_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, donnd+watch_chromium.org, dominich, jfweitz+watch_chromium.org, David Black, samarth+watch_chromium.org, kmadhusu+watch_chromium.org, chromium-apps-reviews_chromium.org, Jered
Project:
chromium
Visibility:
Public.

Description

[Hotword] Uninstall and reinstall the extension upon language change. There are two places we check to see if we need uninstall-install. The first is on startup when the extension system is ready (in response to the ExtensionSystem::ready() OneShot timer). If the extension is currently pending, then we'll check again when we get the notification that the extension has installed when OnExtensionInstalled is called. The function MaybeUninstallHotwordExtension does a series of checks to determine if we should uninstall the extension based on pending installs and previous vs. current locale. If an uninstall is necessary, it kicks it off. Upon Uninstall, OnExtensionUninstalled is triggered. When OnExtensionUninstalled is triggered for the hotword extension, it will reinstall it and update the previous locale (language). If the user goes in to try to uninstall the hotword extension manually, this change will also force it to be reinstalled. This will trigger a second call to OnExtensionInstalled. To prevent a loop, we use HotwordService::uninstall_pending_ to prevent another uninstall attempt. This CL also removes the dependency on the deprecated NOTIFICATION_EXTENSION_INSTALLED as a side effect. Several unittests were added to the unittest suite to test various parts of the uninstall-install pipeline. In order to have access to the extension system during tests, the HotwordServiceTest now extends ExtensionServiceTestBase. BUG=345806 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278644

Patch Set 1 #

Patch Set 2 : fixing logic #

Patch Set 3 : revert files only touched for debugging #

Patch Set 4 : cleanup, fix previous locale logic #

Patch Set 5 : cleanup #

Patch Set 6 : more cleanup #

Total comments: 27

Patch Set 7 : uninstall->reinstall, typos, other fixes #

Patch Set 8 : fix comment #

Total comments: 17

Patch Set 9 : responding to comments #

Total comments: 6

Patch Set 10 : typo, reinstall_pending_ fix #

Patch Set 11 : compile error: only reference an extension installer if extensions are enabled #

Patch Set 12 : fix unittest compile errors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+407 lines, -33 lines) Patch
M chrome/browser/search/hotword_service.h View 1 2 3 4 5 6 7 8 9 5 chunks +45 lines, -0 lines 0 comments Download
M chrome/browser/search/hotword_service.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +166 lines, -31 lines 0 comments Download
M chrome/browser/search/hotword_service_factory.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/search/hotword_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +187 lines, -2 lines 0 comments Download
M chrome/common/pref_names.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
rpetterson
Yoyo, please take a look to make sure I'm handling the extension aspect correctly. Jered, ...
6 years, 6 months ago (2014-06-17 22:52:51 UTC) #1
Yoyo Zhou
I think the extensions stuff looks basically right. Comments inline. https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service.cc#newcode265 ...
6 years, 6 months ago (2014-06-18 00:33:22 UTC) #2
rpetterson
https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service.cc#newcode265 chrome/browser/search/hotword_service.cc:265: profile_ != static_cast<Profile*>(browser_context) || On 2014/06/18 00:33:21, Yoyo Zhou ...
6 years, 6 months ago (2014-06-18 02:08:45 UTC) #3
Yoyo Zhou
Cool, LGTM. https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service_unittest.cc File chrome/browser/search/hotword_service_unittest.cc (right): https://codereview.chromium.org/330193005/diff/100001/chrome/browser/search/hotword_service_unittest.cc#newcode283 chrome/browser/search/hotword_service_unittest.cc:283: EXPECT_TRUE(service()->GetExtensionById( On 2014/06/18 02:08:44, rpetterson wrote: > ...
6 years, 6 months ago (2014-06-18 02:15:49 UTC) #4
Jered
I think I see what this is trying to do, but am a little but ...
6 years, 6 months ago (2014-06-18 15:04:19 UTC) #5
Yoyo Zhou
https://codereview.chromium.org/330193005/diff/140001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/140001/chrome/browser/search/hotword_service.cc#newcode306 chrome/browser/search/hotword_service.cc:306: MaybeReinstallHotwordExtension(); On 2014/06/18 15:04:19, Jered wrote: > Huh? Why ...
6 years, 6 months ago (2014-06-18 19:10:31 UTC) #6
rpetterson
https://codereview.chromium.org/330193005/diff/140001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/140001/chrome/browser/search/hotword_service.cc#newcode152 chrome/browser/search/hotword_service.cc:152: // static On 2014/06/18 15:04:19, Jered wrote: > delete ...
6 years, 6 months ago (2014-06-18 20:48:33 UTC) #7
Jered
lgtm Some nits. This is a little subtle still so I'm not 100% sure I've ...
6 years, 6 months ago (2014-06-18 21:06:04 UTC) #8
rpetterson
https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc#newcode359 chrome/browser/search/hotword_service.cc:359: return reinstall_pending_ = UninstallHotwordExtension(extension_service); On 2014/06/18 21:06:04, Jered wrote: ...
6 years, 6 months ago (2014-06-18 23:05:57 UTC) #9
Jered
https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc#newcode359 chrome/browser/search/hotword_service.cc:359: return reinstall_pending_ = UninstallHotwordExtension(extension_service); On 2014/06/18 23:05:57, rpetterson wrote: ...
6 years, 6 months ago (2014-06-18 23:12:17 UTC) #10
rpetterson
https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc File chrome/browser/search/hotword_service.cc (right): https://codereview.chromium.org/330193005/diff/160001/chrome/browser/search/hotword_service.cc#newcode359 chrome/browser/search/hotword_service.cc:359: return reinstall_pending_ = UninstallHotwordExtension(extension_service); On 2014/06/18 23:12:17, Jered wrote: ...
6 years, 6 months ago (2014-06-18 23:45:35 UTC) #11
rpetterson
The CQ bit was checked by rlp@chromium.org
6 years, 6 months ago (2014-06-20 00:01:05 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlp@chromium.org/330193005/220001
6 years, 6 months ago (2014-06-20 00:02:54 UTC) #13
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_aosp on tryserver.chromium ...
6 years, 6 months ago (2014-06-20 01:06:26 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-20 01:10:15 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_clang_dbg on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_clang_dbg/builds/24632)
6 years, 6 months ago (2014-06-20 01:10:17 UTC) #16
rpetterson
The CQ bit was checked by rlp@chromium.org
6 years, 6 months ago (2014-06-20 06:44:45 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlp@chromium.org/330193005/220001
6 years, 6 months ago (2014-06-20 06:47:40 UTC) #18
commit-bot: I haz the power
6 years, 6 months ago (2014-06-20 07:51:41 UTC) #19
Message was sent while issue was closed.
Change committed as 278644

Powered by Google App Engine
This is Rietveld 408576698