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

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed)

Created:
6 years, 5 months ago by sashab
Modified:
6 years, 5 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org, benwells, tmdiep
Project:
chromium
Visibility:
Public.

Description

Refactored UninstallDialog to take a NativeWindow instead of a Browser Originally, ExtensionUninstallDialog took a Browser argument (which determined which browser window it should be modal to), and a special case was added so the dialog would be modal to the app list if the Browser argument was NULL. Updated this constructor to take the parent NativeWindow directly instead of a Browser, so the dialog can be modal to any parent window. For example, this allows it to be parent to the App Info dialog, and be a proper standalone dialog in ExtensionStorageMonitor. Further refactors can be made as a result of this CL since some of the callsites could be getting a Browser just to be able to launch the dialog, whereas that is not needed anymore if the intention is to launch it as a non-modal dialog. Updated uninstall dialogs launched from the following callsites: - The management Chrome API - The extensions context menu - The 'app disabled' message for when it has requested new permissions - The chrome://extensions page - The context menu of apps in the app list - The 'remove' button in the App Info dialog - The context menu on the New Tab page BUG=388746, 362308 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285541

Patch Set 1 #

Total comments: 13

Patch Set 2 : Added CreateAsStandaloneDialog for extension_storage_monitor #

Total comments: 6

Patch Set 3 : Review feedback #

Total comments: 9

Patch Set 4 : Moved Browser out of ExtensionUninstallDialogViews #

Total comments: 9

Patch Set 5 : Moved Browser and GetParent() logic into constructor #

Total comments: 5

Patch Set 6 : Changed ExtensionUninstallDialog to take a NativeWindow instead of a Browser #

Total comments: 4

Patch Set 7 : Small change: Display the default icon while the real icon is being loaded #

Total comments: 6

Patch Set 8 : Removed the BrowserFinder method, and kept the dialog unconstructed until it's shown #

Total comments: 9

Patch Set 9 : Small review fixes from feedback #

Total comments: 24

Patch Set 10 : Review feedback & todos for unfixed issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -117 lines) Patch
M chrome/browser/extensions/api/management/management_api.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_context_menu_model.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_disabled_ui.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_uninstall_dialog.h View 1 2 3 4 5 6 7 8 9 5 chunks +11 lines, -29 lines 0 comments Download
M chrome/browser/extensions/extension_uninstall_dialog.cc View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -37 lines 0 comments Download
M chrome/browser/ui/app_list/extension_uninstaller.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.mm View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm View 1 2 3 4 5 6 7 3 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc View 1 2 3 4 5 6 7 8 9 8 chunks +11 lines, -34 lines 0 comments Download
M chrome/browser/ui/webui/extensions/extension_settings_handler.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/ntp/app_launcher_handler.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 34 (0 generated)
sashab
tapted@ please initially review whole CL.
6 years, 5 months ago (2014-07-11 03:20:41 UTC) #1
tapted
https://codereview.chromium.org/382133003/diff/1/chrome/browser/extensions/extension_storage_monitor.cc File chrome/browser/extensions/extension_storage_monitor.cc (right): https://codereview.chromium.org/382133003/diff/1/chrome/browser/extensions/extension_storage_monitor.cc#newcode557 chrome/browser/extensions/extension_storage_monitor.cc:557: AppListService::Get(chrome::GetActiveDesktop())->GetAppListWindow(), I don't think this call site is intending ...
6 years, 5 months ago (2014-07-11 04:39:16 UTC) #2
sashab
tapted: Please complete review tmdiep: Please look at extension_storage_monitor and advise :) https://codereview.chromium.org/382133003/diff/1/chrome/browser/extensions/extension_storage_monitor.cc File chrome/browser/extensions/extension_storage_monitor.cc ...
6 years, 5 months ago (2014-07-11 05:58:57 UTC) #3
tapted
lgtm. don't forget to update the CL description. haven't checked mac yet, but it looks ...
6 years, 5 months ago (2014-07-11 06:10:41 UTC) #4
tmdiep
lgtm for extension_storage_monitor, but just remove the includes. https://codereview.chromium.org/382133003/diff/1/chrome/browser/extensions/extension_storage_monitor.cc File chrome/browser/extensions/extension_storage_monitor.cc (right): https://codereview.chromium.org/382133003/diff/1/chrome/browser/extensions/extension_storage_monitor.cc#newcode557 chrome/browser/extensions/extension_storage_monitor.cc:557: AppListService::Get(chrome::GetActiveDesktop())->GetAppListWindow(), ...
6 years, 5 months ago (2014-07-11 06:13:30 UTC) #5
sashab
kalman@chromium.org: Please review changes in chrome/browser/extensions msw@chromium.org: Please review changes in chrome/browser/ui https://codereview.chromium.org/382133003/diff/1/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc File chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc ...
6 years, 5 months ago (2014-07-13 22:57:25 UTC) #6
msw
https://codereview.chromium.org/382133003/diff/40001/chrome/browser/extensions/extension_uninstall_dialog.h File chrome/browser/extensions/extension_uninstall_dialog.h (right): https://codereview.chromium.org/382133003/diff/40001/chrome/browser/extensions/extension_uninstall_dialog.h#newcode54 chrome/browser/extensions/extension_uninstall_dialog.h:54: // the app list (or a child widget in ...
6 years, 5 months ago (2014-07-14 17:38:31 UTC) #7
not at google - send to devlin
https://codereview.chromium.org/382133003/diff/40001/chrome/browser/extensions/extension_uninstall_dialog.h File chrome/browser/extensions/extension_uninstall_dialog.h (right): https://codereview.chromium.org/382133003/diff/40001/chrome/browser/extensions/extension_uninstall_dialog.h#newcode54 chrome/browser/extensions/extension_uninstall_dialog.h:54: // the app list (or a child widget in ...
6 years, 5 months ago (2014-07-15 16:31:04 UTC) #8
sashab
kalman and msw: Just before I proceed with other review feedback, you both made a ...
6 years, 5 months ago (2014-07-17 23:24:41 UTC) #9
msw
https://codereview.chromium.org/382133003/diff/40001/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc File chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc (right): https://codereview.chromium.org/382133003/diff/40001/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc#newcode120 chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc:120: Browser* browser, On 2014/07/17 23:24:41, sasha_b wrote: > On ...
6 years, 5 months ago (2014-07-18 04:03:37 UTC) #10
sashab
Alright, I've done my best :) Please take a look, kalman@ and msw@. The Browser ...
6 years, 5 months ago (2014-07-21 02:50:30 UTC) #11
tapted
(don't forget to update the CL description :) https://codereview.chromium.org/382133003/diff/60001/chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm File chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm (right): https://codereview.chromium.org/382133003/diff/60001/chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm#newcode79 chrome/browser/ui/cocoa/extensions/extension_uninstall_dialog_cocoa.mm:79: new ...
6 years, 5 months ago (2014-07-21 03:41:26 UTC) #12
not at google - send to devlin
My next comment(s) depend on the answer to the "I find this confusing" question. https://codereview.chromium.org/382133003/diff/60001/chrome/browser/extensions/extension_uninstall_dialog.h ...
6 years, 5 months ago (2014-07-21 20:07:49 UTC) #13
sashab
Sorry about the back-and-forth; this is more complicated than I originally thought. https://codereview.chromium.org/382133003/diff/60001/chrome/browser/extensions/extension_uninstall_dialog.h File chrome/browser/extensions/extension_uninstall_dialog.h ...
6 years, 5 months ago (2014-07-22 00:30:43 UTC) #14
not at google - send to devlin
https://codereview.chromium.org/382133003/diff/80001/chrome/browser/extensions/extension_uninstall_dialog.cc File chrome/browser/extensions/extension_uninstall_dialog.cc (right): https://codereview.chromium.org/382133003/diff/80001/chrome/browser/extensions/extension_uninstall_dialog.cc#newcode73 chrome/browser/extensions/extension_uninstall_dialog.cc:73: // If there are no open browser windows, close ...
6 years, 5 months ago (2014-07-23 01:49:21 UTC) #15
sashab
Question mainly for kalman, but all feedback welcome: Is it worth taking the super-naive approach ...
6 years, 5 months ago (2014-07-23 02:04:53 UTC) #16
sashab
+sky who is doing a similar review and may be interested in this as well ...
6 years, 5 months ago (2014-07-23 05:14:24 UTC) #17
sky
On 2014/07/23 05:14:24, sasha_b wrote: > +sky who is doing a similar review and may ...
6 years, 5 months ago (2014-07-23 15:51:28 UTC) #18
sashab
Okay, done a proper refactor now, PTAL. ExtensionUninstallDialog now only takes a NativeWindow (and not ...
6 years, 5 months ago (2014-07-23 23:57:26 UTC) #19
sashab
Sorry, to answer your question scott - I didn't do it in the first place ...
6 years, 5 months ago (2014-07-24 00:31:09 UTC) #20
tapted
(don't forget to update the CL description too) https://codereview.chromium.org/382133003/diff/100001/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.mm File chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.mm (right): https://codereview.chromium.org/382133003/diff/100001/chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.mm#newcode50 chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.mm:50: profile_, ...
6 years, 5 months ago (2014-07-24 00:35:36 UTC) #21
sashab
Removed the BrowserFinder method, and made all callsites get the NativeWindow manually (they should all ...
6 years, 5 months ago (2014-07-24 03:03:36 UTC) #22
tapted
lgtm with the following https://codereview.chromium.org/382133003/diff/140001/chrome/browser/extensions/api/management/management_api.cc File chrome/browser/extensions/api/management/management_api.cc (right): https://codereview.chromium.org/382133003/diff/140001/chrome/browser/extensions/api/management/management_api.cc#newcode615 chrome/browser/extensions/api/management/management_api.cc:615: GetCurrentBrowser()->window()->GetNativeWindow(), So.. I think there's ...
6 years, 5 months ago (2014-07-24 07:09:55 UTC) #23
tapted
sorry - thought of some more possible issues.. perhaps it's worth adding something to extension_install_dialog_view_browsertest ...
6 years, 5 months ago (2014-07-24 07:46:34 UTC) #24
sashab
https://codereview.chromium.org/382133003/diff/140001/chrome/browser/extensions/api/management/management_api.cc File chrome/browser/extensions/api/management/management_api.cc (right): https://codereview.chromium.org/382133003/diff/140001/chrome/browser/extensions/api/management/management_api.cc#newcode615 chrome/browser/extensions/api/management/management_api.cc:615: GetCurrentBrowser()->window()->GetNativeWindow(), On 2014/07/24 07:09:55, tapted wrote: > So.. I ...
6 years, 5 months ago (2014-07-24 08:02:14 UTC) #25
not at google - send to devlin
lgtm but you should get somebody familiar with the views code to sanity check :) ...
6 years, 5 months ago (2014-07-24 17:16:25 UTC) #26
msw
Nice work! lgtm with a comment nit and with the removal of some extraneous includes. ...
6 years, 5 months ago (2014-07-24 19:20:57 UTC) #27
sashab
Thank you all for your input :) tapted: Please take a look at the feedback ...
6 years, 5 months ago (2014-07-25 02:44:34 UTC) #28
tapted
slgtm you can add 362308 to the CL description's BUG= to track in there too ...
6 years, 5 months ago (2014-07-25 04:00:43 UTC) #29
sashab
The CQ bit was checked by sashab@chromium.org
6 years, 5 months ago (2014-07-25 04:02:17 UTC) #30
sashab
The CQ bit was unchecked by sashab@chromium.org
6 years, 5 months ago (2014-07-25 04:02:37 UTC) #31
sashab
The CQ bit was checked by sashab@chromium.org
6 years, 5 months ago (2014-07-25 04:03:00 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sashab@chromium.org/382133003/180001
6 years, 5 months ago (2014-07-25 04:04:56 UTC) #33
commit-bot: I haz the power
6 years, 5 months ago (2014-07-25 09:23:00 UTC) #34
Message was sent while issue was closed.
Change committed as 285541

Powered by Google App Engine
This is Rietveld 408576698