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

Issue 12045037: Refactor modality-specific behavior from ConstrainedWindowViews to WebContentsModalDialogManager (Closed)

Created:
7 years, 11 months ago by Mike Wittman
Modified:
7 years, 10 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, Raman Kakilate, groby+watch_chromium.org, ben+watch_chromium.org, tfarina, benquan, dhollowa+watch_chromium.org, rouslan+watch_chromium.org, ahutter, dbeam+watch-autofill_chromium.org, sail+watch_chromium.org, Aaron Boodman, Dane Wallinga, dyu1, estade+watch_chromium.org, gbillock+watch_chromium.org, Albert Bodenhamer, smckay+watch_chromium.org, Ilya Sherman, msw
Visibility:
Public.

Description

Refactor modality-specific behavior from ConstrainedWindowViews to WebContentsModalDialogManager This CL moves the Views web contents modal dialog code towards the interface described in the associated bug. Similar changes for Gtk and Cocoa will be made in follow-on CLs. To that end, this CL contains the following detailed changes: - Introduce NativeWebContentsModalDialogManager for providing platform-specific UI functionality within WebContentsModalDialogManager, and implement NativeWebContentsModalDialogManagerViews. - Under Views, move to a model where WebContentsModalDialogManager listens for closing events rather than requiring notifications from the widget. Continue using the existing model on Gtk and Cocoa, pending refactoring there. - Provide a mechanism for disabling mouse-driven dialog movement on Widget. - Remove NativeConstrainedWindowDelegate and subclasses as they're no longer necessary due to the above two items. - Update tests to account for closing notification to WebContentsModalDialogManager being done from the event loop, rather than synchronously. - Add temporary ConstrainedWindowViews factory function to minimize code churn at construction sites during this refactoring. The next planned steps in this work are: - Refactor ConstrainedWindow subclasses under Gtk and Cocoa to listen for closing events rather than requiring notifications from the widget. - Refactor uses of WebContentsModalDialog interface to use platform-specific equivalents in platform-specific code and, in platform-independent code, invoke functionality via some other mechanism: platform_utils, WebContentsModalDialogManager, ???. Remove WebContentsModalDialog interface. - Generalize WebContentsModalDialogManagerDelegate positioning interface and write WebContentsModalDialogManager::ShowDialog using the new interface. BUG=157161 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180904

Patch Set 1 #

Total comments: 16

Patch Set 2 : address review comments #

Patch Set 3 : fix additional native manager names #

Patch Set 4 : rebase #

Patch Set 5 : fix Android link error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -227 lines) Patch
M chrome/browser/ui/browser_command_controller_browsertest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/browser/ui/native_web_contents_modal_dialog_manager.h View 1 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/autofill/autofill_dialog_views.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/collected_cookies_views.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/constrained_window_views.h View 3 chunks +7 lines, -43 lines 0 comments Download
M chrome/browser/ui/views/constrained_window_views.cc View 1 2 3 8 chunks +26 lines, -55 lines 0 comments Download
M chrome/browser/ui/views/constrained_window_views_browsertest.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/login_prompt_views.cc View 1 chunk +1 line, -1 line 0 comments Download
D chrome/browser/ui/views/native_constrained_window_aura.cc View 1 chunk +0 lines, -48 lines 0 comments Download
D chrome/browser/ui/views/native_constrained_window_win.cc View 1 chunk +0 lines, -60 lines 0 comments Download
M chrome/browser/ui/views/ssl_client_certificate_selector.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc View 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc View 1 2 1 chunk +112 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/web_intent_picker_views.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/web_contents_modal_dialog_manager.h View 1 2 4 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/ui/web_contents_modal_dialog_manager.cc View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/web_contents_modal_dialog_manager_unittest.cc View 1 2 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 7 chunks +8 lines, -3 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/widget.h View 2 chunks +8 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Mike Wittman
Hi Ben, please take a look at this next change for the Constrained Window API ...
7 years, 11 months ago (2013-01-23 00:39:27 UTC) #1
tfarina
On Tue, Jan 22, 2013 at 10:39 PM, <wittman@chromium.org> wrote: > Reviewers: Ben Goodger (Google), ...
7 years, 11 months ago (2013-01-23 00:42:05 UTC) #2
Ben Goodger (Google)
I'm looking at this now... On Tue, Jan 22, 2013 at 4:39 PM, <wittman@chromium.org> wrote: ...
7 years, 11 months ago (2013-01-23 18:57:25 UTC) #3
Ben Goodger (Google)
I really like where this is going! Just nits. https://codereview.chromium.org/12045037/diff/1/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm File chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm (right): https://codereview.chromium.org/12045037/diff/1/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm#newcode8 chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm:8: ...
7 years, 11 months ago (2013-01-23 19:10:46 UTC) #4
Mike Wittman
https://codereview.chromium.org/12045037/diff/1/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm File chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm (right): https://codereview.chromium.org/12045037/diff/1/chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm#newcode8 chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm:8: CreateUIDelegate(WebContentsModalDialogManager* manager) { On 2013/01/23 19:10:46, Ben Goodger (Google) ...
7 years, 11 months ago (2013-01-23 21:52:30 UTC) #5
Ben Goodger (Google)
lgtm
7 years, 11 months ago (2013-01-23 22:37:26 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wittman@chromium.org/12045037/28001
7 years, 10 months ago (2013-02-05 22:28:37 UTC) #7
commit-bot: I haz the power
Failed to apply patch for ash/desktop_background/desktop_background_view.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 10 months ago (2013-02-05 22:28:54 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wittman@chromium.org/12045037/33002
7 years, 10 months ago (2013-02-05 22:52:43 UTC) #9
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-05 23:54:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wittman@chromium.org/12045037/44001
7 years, 10 months ago (2013-02-06 01:30:21 UTC) #11
commit-bot: I haz the power
7 years, 10 months ago (2013-02-06 06:50:25 UTC) #12
Message was sent while issue was closed.
Change committed as 180904

Powered by Google App Engine
This is Rietveld 408576698