OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ | |
6 #define COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ | |
7 | |
8 #include <deque> | |
Mike Wittman
2014/06/02 19:54:50
No need for this include.
Greg Billock
2014/06/03 01:30:07
Done.
| |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "components/web_modal/single_popup_manager.h" | |
12 #include "content/public/browser/web_contents_user_data.h" | |
Mike Wittman
2014/06/02 19:54:50
Same here.
Greg Billock
2014/06/03 01:30:07
Done.
Greg Billock
2014/06/03 01:30:07
Done.
| |
13 #include "ui/gfx/native_widget_types.h" | |
Mike Wittman
2014/06/02 19:54:50
And here, I think.
Greg Billock
2014/06/03 01:30:07
Done.
| |
14 | |
15 namespace content { | |
16 struct FrameNavigateParams; | |
17 struct LoadCommittedDetails; | |
Mike Wittman
2014/06/02 19:54:50
No need for the previous two forward decls.
Greg Billock
2014/06/03 01:30:07
Done.
| |
18 class WebContents; | |
19 } | |
20 | |
21 namespace web_modal { | |
22 | |
23 // Per-Browser class to manage popups (bubbles, web-modal dialogs). | |
24 class PopupManager : public SinglePopupManagerDelegate { | |
25 public: | |
26 PopupManager(); | |
27 | |
28 virtual ~PopupManager(); | |
29 | |
30 // Schedules a popup governed by the |manager| to be shown. The popup | |
31 // may be shown inline with this call, at a later time, or not at all. | |
32 void ShowPopup(scoped_ptr<SinglePopupManager> manager); | |
33 | |
34 // Temporary method: Provides compatibility wth existing | |
35 // WebContentsModalDialogManager code. | |
36 void ShowModalDialog(NativePopup popup, content::WebContents* web_contents); | |
37 | |
38 // Returns true if a web modal dialog is active and not closed in the | |
39 // given |web_contents|. Note: this is intended for legacy use only; it will | |
40 // be deleted at some point -- new code shouldn't use it. | |
41 bool IsWebModalDialogActive(const content::WebContents* web_contents) const; | |
42 | |
43 // Called by views code to re-activate popups anchored to a particular tab | |
44 // when that tab gets focus. Note that depending on the situation, more than | |
45 // one popup may actually be shown (depending on overlappability). The | |
46 // semantics are that the popups that would have been displayed had the tab | |
47 // never lost focus are re-focused when tab focus is regained. | |
48 void WasFocused(const content::WebContents* web_contents); | |
49 | |
50 // Called when a NativePopup we own is about to be closed. | |
51 virtual void WillClose(NativePopup popup) OVERRIDE; | |
52 | |
53 private: | |
54 friend class PopupManagerTest; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(PopupManager); | |
57 }; | |
58 | |
59 } // namespace web_modal | |
60 | |
61 #endif // COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ | |
OLD | NEW |