Index: chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h |
diff --git a/chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h b/chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b43821221a3ff8d7c6d03d47c871d3d8e6f3e182 |
--- /dev/null |
+++ b/chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h |
@@ -0,0 +1,57 @@ |
+// 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 CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ |
+#define CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ |
+ |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+#include "ui/views/bubble/bubble_delegate.h" |
+ |
+namespace content { |
+class NotificationDetails; |
+class NotificationSource; |
+class WebContents; |
+}; |
+ |
+namespace views { |
+class View; |
vasilii
2014/12/18 16:16:22
it's already included.
Pritam Nikam
2014/12/19 09:16:54
Done.
|
+} |
+ |
+// View used to display the bubble popup and manages the browser's full screen |
+// state transition notifications. |
vasilii
2014/12/18 16:16:22
It closes on browser's full screen transition noti
Pritam Nikam
2014/12/19 09:16:54
Done.
|
+class ManagedFullScreenBubbleDelegateView |
+ : public views::BubbleDelegateView, |
+ public content::NotificationObserver { |
+ public: |
+ ManagedFullScreenBubbleDelegateView(views::View* anchor_view, |
+ content::WebContents* web_contents); |
+ ~ManagedFullScreenBubbleDelegateView() override; |
+ |
+ // content::NotificationObserver: |
+ void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) override; |
+ |
+ protected: |
+ // If the bubble is not anchored to a view, places the bubble in the top |
+ // right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s |
+ // browser window. Because the positioning is based on the size of the |
+ // bubble, this must be called after the bubble is created. |
+ void AdjustForFullscreen(const gfx::Rect& screen_bounds); |
+ |
+ // views::View: |
+ bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
+ |
+ // Close the bubble. |
+ virtual void Close(); |
+ |
+ private: |
+ // Used to register for fullscreen change notifications. |
+ content::NotificationRegistrar registrar_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ManagedFullScreenBubbleDelegateView); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ |