|
|
DescriptionHook up runtime API to implement ExtensionRegistryObserver.
* Also open the extension "uninstall URL" only when uninstall is user initiated.
BUG=84556
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285079
Patch Set 1 #
Total comments: 8
Patch Set 2 : Address code review feedback. #
Total comments: 2
Patch Set 3 : Address code review feedback. #
Total comments: 2
Patch Set 4 : Address code review feedback. #Patch Set 5 : Fix clang build warning. #
Total comments: 1
Messages
Total messages: 16 (0 generated)
This is the fix to show an extension's uninstall URL only when the uninstall action is user initiated.
https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:164: switch (type) { Let's make this DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type) and then do the body of OnExtensionsReady() in here. https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:177: OnExtensionLoaded(extension); Let's put the OnExtensionLoaded method body in here, since it's only used here (same for WillBeInstalled and Uninstalled) https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:417: (reason == UNINSTALL_REASON_MANAGEMENT_API); I think it's readable enough to inline this in the if statement.
PTAL https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:164: switch (type) { On 2014/07/22 00:26:58, Devlin wrote: > Let's make this DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type) and then > do the body of OnExtensionsReady() in here. Done. https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:177: OnExtensionLoaded(extension); On 2014/07/22 00:26:59, Devlin wrote: > Let's put the OnExtensionLoaded method body in here, since it's only used here > (same for WillBeInstalled and Uninstalled) Done. https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:417: (reason == UNINSTALL_REASON_MANAGEMENT_API); On 2014/07/22 00:26:59, Devlin wrote: > I think it's readable enough to inline this in the if statement. Done.
https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:164: switch (type) { On 2014/07/22 16:34:21, rpaquay wrote: > On 2014/07/22 00:26:58, Devlin wrote: > > Let's make this DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type) and > then > > do the body of OnExtensionsReady() in here. > > Done. Sorry, what I meant by this was to do: DCHECK_EQ(...) // We're done restarting Chrome after an update. dispatch_chrome_updated_event_ = false; .... and then delete the OnExtensionsReady() function. https://codereview.chromium.org/406063002/diff/40001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.h (right): https://codereview.chromium.org/406063002/diff/40001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.h:81: content::BrowserContext* browser_context, let's move this above the BCKAPI impl methods so that they stay in order in the .cc file.
https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/406063002/diff/20001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.cc:164: switch (type) { On 2014/07/22 22:21:12, Devlin wrote: > On 2014/07/22 16:34:21, rpaquay wrote: > > On 2014/07/22 00:26:58, Devlin wrote: > > > Let's make this DCHECK_EQ(chrome::NOTIFICATION_EXTENSIONS_READY, type) and > > then > > > do the body of OnExtensionsReady() in here. > > > > Done. > > Sorry, what I meant by this was to do: > DCHECK_EQ(...) > // We're done restarting Chrome after an update. > dispatch_chrome_updated_event_ = false; > .... > > and then delete the OnExtensionsReady() function. Done. https://codereview.chromium.org/406063002/diff/40001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.h (right): https://codereview.chromium.org/406063002/diff/40001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.h:81: content::BrowserContext* browser_context, On 2014/07/22 22:21:12, Devlin wrote: > let's move this above the BCKAPI impl methods so that they stay in order in the > .cc file. Done.
lgtm! https://codereview.chromium.org/406063002/diff/60001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.h (right): https://codereview.chromium.org/406063002/diff/60001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.h:39: nit: Also forward-declare ExtensionRegistry.
https://codereview.chromium.org/406063002/diff/60001/extensions/browser/api/r... File extensions/browser/api/runtime/runtime_api.h (right): https://codereview.chromium.org/406063002/diff/60001/extensions/browser/api/r... extensions/browser/api/runtime/runtime_api.h:39: On 2014/07/23 15:26:44, Devlin wrote: > nit: Also forward-declare ExtensionRegistry. Done.
The CQ bit was checked by rpaquay@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rpaquay@chromium.org/406063002/80001
The CQ bit was checked by rpaquay@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rpaquay@chromium.org/406063002/100001
Message was sent while issue was closed.
Change committed as 285079
Message was sent while issue was closed.
https://codereview.chromium.org/406063002/diff/100001/extensions/browser/api/... File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/406063002/diff/100001/extensions/browser/api/... extensions/browser/api/runtime/runtime_api.cc:393: reason == UNINSTALL_REASON_MANAGEMENT_API)) { I'm reading through the various uninstall reasons and it seems like UNINSTALL_REASON_EXTENSION_DISABLED and UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED should be in here as well? - https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ext... - https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ext... (the former name is rather misleading by the way) basically anything which is associated with a user action (iff it's already installed) should trigger the uninstalled handler.
Message was sent while issue was closed.
also is it possible to test the uninstall-from-sync case and make sure it doesn't fire the listener?
Message was sent while issue was closed.
That browser test for the uninstall URL is darn awkward the way it sets up a whole extension just to check that a URL was opened. It's also fairly limited. It could do with at least a sync test, but also testing that various uninstall URLs can't be set, like mailto:, javascript:, etc. and that doesn't appear to be implemented at all. No URL validation is implemented: https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser...
Message was sent while issue was closed.
On 2014/07/30 02:46:27, kalman wrote: > That browser test for the uninstall URL is darn awkward the way it sets up a > whole extension just to check that a URL was opened. > > It's also fairly limited. It could do with at least a sync test, but also > testing that various uninstall URLs can't be set, like mailto:, javascript:, > etc. > > and that doesn't appear to be implemented at all. No URL validation is > implemented: > https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser... I looked in the wrong place, it does check is_valid(). But this will include every possible URL. https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser... |