Refactor modality-specific behavior from ConstrainedWindowViews to WebContentsModalDi...
commit51a2478710c9b2beda273832f2e4f4c825aa279a
authorwittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 6 Feb 2013 06:50:23 +0000 (6 06:50 +0000)
committerwittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 6 Feb 2013 06:50:23 +0000 (6 06:50 +0000)
tree77a926fd642222b69989250f7295d95d3cd42724
parent8cea789efbec4198ab2315ee2f49927523832d2f
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

Review URL: https://chromiumcodereview.appspot.com/12045037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180904 0039d316-1c4b-4281-b951-d872f2087c98
26 files changed:
chrome/browser/ui/browser_command_controller_browsertest.cc
chrome/browser/ui/cocoa/web_contents_modal_dialog_manager_cocoa.mm [new file with mode: 0644]
chrome/browser/ui/gtk/web_contents_modal_dialog_manager_gtk.cc [new file with mode: 0644]
chrome/browser/ui/native_web_contents_modal_dialog_manager.h [new file with mode: 0644]
chrome/browser/ui/views/autofill/autofill_dialog_views.cc
chrome/browser/ui/views/collected_cookies_views.cc
chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
chrome/browser/ui/views/constrained_window_views.cc
chrome/browser/ui/views/constrained_window_views.h
chrome/browser/ui/views/constrained_window_views_browsertest.cc
chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
chrome/browser/ui/views/login_prompt_views.cc
chrome/browser/ui/views/native_constrained_window_aura.cc [deleted file]
chrome/browser/ui/views/native_constrained_window_win.cc [deleted file]
chrome/browser/ui/views/ssl_client_certificate_selector.cc
chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc
chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc [new file with mode: 0644]
chrome/browser/ui/views/web_intent_picker_views.cc
chrome/browser/ui/web_contents_modal_dialog_manager.cc
chrome/browser/ui/web_contents_modal_dialog_manager.h
chrome/browser/ui/web_contents_modal_dialog_manager_unittest.cc
chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc
chrome/chrome_browser_ui.gypi
chrome/chrome_tests_unit.gypi
ui/views/widget/widget.cc
ui/views/widget/widget.h