| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H
_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H
_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H
_ | 6 #define CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEWS_H
_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/web_modal/modal_dialog_host.h" | 11 #include "components/web_modal/modal_dialog_host.h" |
| 12 #include "components/web_modal/single_web_contents_dialog_manager.h" | 12 #include "components/web_modal/single_web_contents_dialog_manager.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 14 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 class Widget; | 17 class Widget; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // Class for parenting a tab-modal views dialog off of a views browser. | 20 // Class for parenting a tab-modal views dialog off of a views browser. |
| 21 class NativeWebContentsModalDialogManagerViews | 21 class NativeWebContentsModalDialogManagerViews |
| 22 : public web_modal::SingleWebContentsDialogManager, | 22 : public web_modal::SingleWebContentsDialogManager, |
| 23 public web_modal::ModalDialogHostObserver, | 23 public web_modal::ModalDialogHostObserver, |
| 24 public views::WidgetObserver { | 24 public views::WidgetObserver { |
| 25 public: | 25 public: |
| 26 NativeWebContentsModalDialogManagerViews( | 26 NativeWebContentsModalDialogManagerViews( |
| 27 gfx::NativeWindow dialog, | 27 gfx::NativeWindow dialog, |
| 28 web_modal::SingleWebContentsDialogManagerDelegate* native_delegate); | 28 web_modal::SingleWebContentsDialogManagerDelegate* native_delegate, |
| 29 bool* independent_bounds, |
| 30 const char* kHasIndependentBoundsKey); |
| 29 | 31 |
| 30 ~NativeWebContentsModalDialogManagerViews() override; | 32 ~NativeWebContentsModalDialogManagerViews() override; |
| 31 | 33 |
| 32 // Sets up this object to manage the |dialog_|. Registers for closing events | 34 // Sets up this object to manage the |dialog_|. Registers for closing events |
| 33 // in order to notify the delegate. | 35 // in order to notify the delegate. |
| 34 void ManageDialog(); | 36 void ManageDialog(bool* independent_bounds, |
| 37 const char * kHasIndependentBoundsKey); |
| 35 | 38 |
| 36 // web_modal::SingleWebContentsDialogManager: | 39 // web_modal::SingleWebContentsDialogManager: |
| 37 void Show() override; | 40 void Show() override; |
| 38 void Hide() override; | 41 void Hide() override; |
| 39 void Close() override; | 42 void Close() override; |
| 40 void Focus() override; | 43 void Focus() override; |
| 41 void Pulse() override; | 44 void Pulse() override; |
| 42 | 45 |
| 43 // web_modal::ModalDialogHostObserver: | 46 // web_modal::ModalDialogHostObserver: |
| 44 void OnPositionRequiresUpdate() override; | 47 void OnPositionRequiresUpdate() override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 67 gfx::NativeWindow dialog_; | 70 gfx::NativeWindow dialog_; |
| 68 web_modal::WebContentsModalDialogHost* host_; | 71 web_modal::WebContentsModalDialogHost* host_; |
| 69 bool host_destroying_; | 72 bool host_destroying_; |
| 70 std::set<views::Widget*> observed_widgets_; | 73 std::set<views::Widget*> observed_widgets_; |
| 71 std::set<views::Widget*> shown_widgets_; | 74 std::set<views::Widget*> shown_widgets_; |
| 72 | 75 |
| 73 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); | 76 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerViews); |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 #endif // CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEW
S_H_ | 79 #endif // CHROME_BROWSER_UI_VIEWS_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_VIEW
S_H_ |
| OLD | NEW |