Chromium Code Reviews| Index: components/constrained_window/native_web_contents_modal_dialog_manager_views.h |
| diff --git a/chrome/browser/ui/views/native_web_contents_modal_dialog_manager_views.h b/components/constrained_window/native_web_contents_modal_dialog_manager_views.h |
| similarity index 77% |
| rename from chrome/browser/ui/views/native_web_contents_modal_dialog_manager_views.h |
| rename to components/constrained_window/native_web_contents_modal_dialog_manager_views.h |
| index 21b2b9b3bf31f661d43accca3ac819642146bcde..382b9ce8cad05c93948100ca109ac8965913d206 100644 |
| --- a/chrome/browser/ui/views/native_web_contents_modal_dialog_manager_views.h |
| +++ b/components/constrained_window/native_web_contents_modal_dialog_manager_views.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |
| -#define CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |
| +#ifndef COMPONENTS_CONSTRAINED_WINDOW_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |
| +#define COMPONENTS_CONSTRAINED_WINDOW_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |
| #include <set> |
| @@ -17,6 +17,8 @@ namespace views { |
| class Widget; |
| } |
| +namespace constrained_window { |
| + |
| // Class for parenting a tab-modal views dialog off of a views browser. |
| class NativeWebContentsModalDialogManagerViews |
| : public web_modal::SingleWebContentsDialogManager, |
| @@ -59,8 +61,20 @@ class NativeWebContentsModalDialogManagerViews |
| void HostChanged(web_modal::WebContentsModalDialogHost* new_host) override; |
| gfx::NativeWindow dialog() override; |
| - private: |
| + protected: |
| + web_modal::SingleWebContentsDialogManagerDelegate* native_delegate() { |
|
tapted
2016/06/29 03:02:45
This should stay in the follow-up CL, along with t
Patti Lor
2016/07/13 03:09:41
Done.
|
| + return native_delegate_; |
| + } |
| + |
| + // By default just calls widget->Show() or Hide(), but allows a derived class |
| + // to override in order to hide an alternate way (e.g. if the default hide |
| + // would tear down attached dialogs too early). |
| + virtual void ShowWidget(views::Widget* widget); |
| + virtual void HideWidget(views::Widget* widget); |
| + |
| static views::Widget* GetWidget(gfx::NativeWindow dialog); |
| + |
| + private: |
| void WidgetClosing(views::Widget* widget); |
| web_modal::SingleWebContentsDialogManagerDelegate* native_delegate_; |
| @@ -73,4 +87,6 @@ class NativeWebContentsModalDialogManagerViews |
| DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); |
| }; |
| -#endif // CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |
| +} // namespace constrained_window |
| + |
| +#endif // COMPONENTS_CONSTRAINED_WINDOW_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H_ |