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

Issue 2803923002: [Media Router] Unload the legacy Cast extension at install (Closed)

Created:
3 years, 8 months ago by takumif
Modified:
3 years, 8 months ago
Reviewers:
Devlin, imcheng
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Media Router] Unload the legacy Cast extension at install This change makes ComponentToolbarActionsFactory unload the Cast extension when the toolbar model becomes ready or the extension gets installed. Previously, we were unloading the extension when the toolbar became ready (only if the extension was enabled), but not if it was installed afterwards, which could happen because of profile sync. BUG=691575

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Unload instead of uninstall #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -39 lines) Patch
M chrome/browser/ui/toolbar/component_toolbar_actions_factory.h View 1 2 3 chunks +24 lines, -11 lines 0 comments Download
M chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc View 1 2 3 chunks +23 lines, -12 lines 0 comments Download
M chrome/browser/ui/toolbar/component_toolbar_actions_factory_unittest.cc View 1 2 2 chunks +35 lines, -11 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_model.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 13 (9 generated)
takumif
Please take a look. I couldn't tell if it's safe to call ExtensionService::UninstallExtension() from ExtensionRegistryObserver::OnExtensionInstalled(), ...
3 years, 8 months ago (2017-04-06 04:00:11 UTC) #6
Devlin
On 2017/04/06 04:00:11, takumif wrote: > Please take a look. > I couldn't tell if ...
3 years, 8 months ago (2017-04-06 21:34:40 UTC) #7
takumif
On 2017/04/06 21:34:40, Devlin wrote: > On 2017/04/06 04:00:11, takumif wrote: > > Please take ...
3 years, 8 months ago (2017-04-07 18:22:25 UTC) #12
Devlin
3 years, 8 months ago (2017-04-10 22:48:00 UTC) #13
On 2017/04/07 18:22:25, takumif wrote:
> On 2017/04/06 21:34:40, Devlin wrote:
> > On 2017/04/06 04:00:11, takumif wrote:
> > > Please take a look.
> > > I couldn't tell if it's safe to call
ExtensionService::UninstallExtension()
> > from
> > > ExtensionRegistryObserver::OnExtensionInstalled(), but I found a
precedence
> > [1].
> > > Please let me know if there's a better way. Thanks!
> > > 
> > > [1]
> > >
> >
>
https://cs.chromium.org/chromium/src/chrome/browser/search/hotword_service.cc...
> > 
> > Hmm...
> > 
> > Two thoughts.
> > - This does seem like an odd place for the uninstallation.  If we go this
> route,
> > I'd prefer to put this in ExtensionService, sometime after initialization.
> > - Usually, we don't uninstall non-component extensions directly in chrome,
but
> > rather through the extension itself (using the management.uninstallSelf
> method).
> >  Is there a strong reason to uninstall this non-component extension through
> > chrome itself?
> 
> We think we can make the extension uninstall itself, so we'll try doing that.
> We've already removed the extension from the codebase so we'll need to put it
> back (at least the necessary parts) first.
> In the meantime we'd like to fix the bug by unloading the extension at startup
> and installation of the extension. We're basically making the
> ComponentToolbarActionsFactory do what the ComponentMigrationHelper [1] used
to
> do. Please take a look, thanks.
> 
> 
> [1]
>
https://codereview.chromium.org/2678083005/diff/140001/chrome/browser/extensi...

Hmm... this is a bit complicated.  If we always unload the extension here, then
the extension will never be able to uninstall itself (because it'll never be
running).

Pushing a change to the extension should be pretty quick (actually quicker than
waiting for a fix to percolate through the chrome release cycle); is there a
reason that approach isn't preferred?

Otherwise, we'll probably have to go with the approach of uninstalling here,
though that's not necessarily my preference (and in which case my initial
comment that this is better in a more central location like ExtensionService
will still stand).

Powered by Google App Engine
This is Rietveld 408576698