OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_POPUP_MANAGER_H_ | 5 #ifndef COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |
6 #define COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ | 6 #define COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/web_modal/single_popup_manager.h" | 10 #include "components/web_modal/single_popup_manager.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // WebContentsUserData-alike API for retrieving the associated window | 60 // WebContentsUserData-alike API for retrieving the associated window |
61 // PopupManager from a |web_contents|. Any window which doesn't have a popup | 61 // PopupManager from a |web_contents|. Any window which doesn't have a popup |
62 // manager associated will return null -- popups should not be issued against | 62 // manager associated will return null -- popups should not be issued against |
63 // that window. | 63 // that window. |
64 static PopupManager* FromWebContents(content::WebContents* web_contents); | 64 static PopupManager* FromWebContents(content::WebContents* web_contents); |
65 | 65 |
66 // Should not be called except by WebContents-owning class; not by clients. | 66 // Should not be called except by WebContents-owning class; not by clients. |
67 void RegisterWith(content::WebContents* web_contents); | 67 void RegisterWith(content::WebContents* web_contents); |
68 void UnregisterWith(content::WebContents* web_contents); | 68 void UnregisterWith(content::WebContents* web_contents); |
69 | 69 |
| 70 WebContentsModalDialogHost* host() { return host_; } |
| 71 |
70 // DEPRECATED. | 72 // DEPRECATED. |
71 virtual void CloseAllDialogsForTesting(content::WebContents* web_contents); | 73 virtual void CloseAllDialogsForTesting(content::WebContents* web_contents); |
72 | 74 |
73 private: | 75 private: |
74 WebContentsModalDialogHost* host_; | 76 WebContentsModalDialogHost* host_; |
75 | 77 |
76 base::WeakPtrFactory<PopupManager> weak_factory_; | 78 base::WeakPtrFactory<PopupManager> weak_factory_; |
77 | 79 |
78 DISALLOW_COPY_AND_ASSIGN(PopupManager); | 80 DISALLOW_COPY_AND_ASSIGN(PopupManager); |
79 }; | 81 }; |
80 | 82 |
81 } // namespace web_modal | 83 } // namespace web_modal |
82 | 84 |
83 #endif // COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ | 85 #endif // COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |
OLD | NEW |