Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
| 6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "components/web_modal/single_web_contents_dialog_manager.h" | 14 #include "components/web_modal/single_web_contents_dialog_manager.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/browser/web_contents_user_data.h" | 16 #include "content/public/browser/web_contents_user_data.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 17 | 18 |
| 18 namespace web_modal { | 19 namespace web_modal { |
| 19 | 20 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 47 // Returns true if any dialogs are active and not closed. | 48 // Returns true if any dialogs are active and not closed. |
| 48 bool IsDialogActive() const; | 49 bool IsDialogActive() const; |
| 49 | 50 |
| 50 // Focus the topmost modal dialog. IsDialogActive() must be true when calling | 51 // Focus the topmost modal dialog. IsDialogActive() must be true when calling |
| 51 // this function. | 52 // this function. |
| 52 void FocusTopmostDialog() const; | 53 void FocusTopmostDialog() const; |
| 53 | 54 |
| 54 // SingleWebContentsDialogManagerDelegate: | 55 // SingleWebContentsDialogManagerDelegate: |
| 55 content::WebContents* GetWebContents() const override; | 56 content::WebContents* GetWebContents() const override; |
| 56 void WillClose(gfx::NativeWindow dialog) override; | 57 void WillClose(gfx::NativeWindow dialog) override; |
| 58 bool IsNonClipped(gfx::NativeWindow dialog) const override; | |
| 59 void AddNonClippedDialog(gfx::NativeWindow dialog) override; | |
|
Mike Wittman
2016/08/19 14:57:29
why do we need this function?
rbpotter
2016/08/19 16:59:42
I added it in since ShowModalDialog moved to show_
Mike Wittman
2016/08/19 17:51:42
I see. This approach is kind of odd because at the
| |
| 57 | 60 |
| 58 // For testing. | 61 // For testing. |
| 59 class TestApi { | 62 class TestApi { |
| 60 public: | 63 public: |
| 61 explicit TestApi(WebContentsModalDialogManager* manager) | 64 explicit TestApi(WebContentsModalDialogManager* manager) |
| 62 : manager_(manager) {} | 65 : manager_(manager) {} |
| 63 | 66 |
| 64 void CloseAllDialogs() { manager_->CloseAllDialogs(); } | 67 void CloseAllDialogs() { manager_->CloseAllDialogs(); } |
| 65 void DidAttachInterstitialPage() { manager_->DidAttachInterstitialPage(); } | 68 void DidAttachInterstitialPage() { manager_->DidAttachInterstitialPage(); } |
| 66 void WebContentsWasShown() { manager_->WasShown(); } | 69 void WebContentsWasShown() { manager_->WasShown(); } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 void WasHidden() override; | 111 void WasHidden() override; |
| 109 void WebContentsDestroyed() override; | 112 void WebContentsDestroyed() override; |
| 110 void DidAttachInterstitialPage() override; | 113 void DidAttachInterstitialPage() override; |
| 111 | 114 |
| 112 // Delegate for notifying our owner about stuff. Not owned by us. | 115 // Delegate for notifying our owner about stuff. Not owned by us. |
| 113 WebContentsModalDialogManagerDelegate* delegate_; | 116 WebContentsModalDialogManagerDelegate* delegate_; |
| 114 | 117 |
| 115 // All active dialogs. | 118 // All active dialogs. |
| 116 WebContentsModalDialogList child_dialogs_; | 119 WebContentsModalDialogList child_dialogs_; |
| 117 | 120 |
| 121 // All non clipped active dialogs | |
| 122 std::set<gfx::NativeWindow> nonclipped_child_dialogs_; | |
| 123 | |
| 118 // True while closing the dialogs on WebContents close. | 124 // True while closing the dialogs on WebContents close. |
| 119 bool closing_all_dialogs_; | 125 bool closing_all_dialogs_; |
| 120 | 126 |
| 121 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager); | 127 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager); |
| 122 }; | 128 }; |
| 123 | 129 |
| 124 } // namespace web_modal | 130 } // namespace web_modal |
| 125 | 131 |
| 126 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 132 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
| OLD | NEW |