Index: components/web_modal/popup_manager.h |
diff --git a/components/web_modal/popup_manager.h b/components/web_modal/popup_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..be8ce479cda925687c36f98bf9db61906bf8e5ea |
--- /dev/null |
+++ b/components/web_modal/popup_manager.h |
@@ -0,0 +1,61 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |
+#define COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |
+ |
+#include <deque> |
Mike Wittman
2014/06/02 19:54:50
No need for this include.
Greg Billock
2014/06/03 01:30:07
Done.
|
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "components/web_modal/single_popup_manager.h" |
+#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.
|
+#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.
|
+ |
+namespace content { |
+struct FrameNavigateParams; |
+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.
|
+class WebContents; |
+} |
+ |
+namespace web_modal { |
+ |
+// Per-Browser class to manage popups (bubbles, web-modal dialogs). |
+class PopupManager : public SinglePopupManagerDelegate { |
+ public: |
+ PopupManager(); |
+ |
+ virtual ~PopupManager(); |
+ |
+ // Schedules a popup governed by the |manager| to be shown. The popup |
+ // may be shown inline with this call, at a later time, or not at all. |
+ void ShowPopup(scoped_ptr<SinglePopupManager> manager); |
+ |
+ // Temporary method: Provides compatibility wth existing |
+ // WebContentsModalDialogManager code. |
+ void ShowModalDialog(NativePopup popup, content::WebContents* web_contents); |
+ |
+ // Returns true if a web modal dialog is active and not closed in the |
+ // given |web_contents|. Note: this is intended for legacy use only; it will |
+ // be deleted at some point -- new code shouldn't use it. |
+ bool IsWebModalDialogActive(const content::WebContents* web_contents) const; |
+ |
+ // Called by views code to re-activate popups anchored to a particular tab |
+ // when that tab gets focus. Note that depending on the situation, more than |
+ // one popup may actually be shown (depending on overlappability). The |
+ // semantics are that the popups that would have been displayed had the tab |
+ // never lost focus are re-focused when tab focus is regained. |
+ void WasFocused(const content::WebContents* web_contents); |
+ |
+ // Called when a NativePopup we own is about to be closed. |
+ virtual void WillClose(NativePopup popup) OVERRIDE; |
+ |
+ private: |
+ friend class PopupManagerTest; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PopupManager); |
+}; |
+ |
+} // namespace web_modal |
+ |
+#endif // COMPONENTS_WEB_MODAL_POPUP_MANAGER_H_ |