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 CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ | |
7 | |
8 #include "content/public/browser/notification_observer.h" | |
9 #include "content/public/browser/notification_registrar.h" | |
10 #include "ui/views/bubble/bubble_delegate.h" | |
11 | |
12 namespace content { | |
13 class NotificationDetails; | |
14 class NotificationSource; | |
15 class WebContents; | |
16 }; | |
17 | |
18 // View used to automatically close a bubble when the browser transitions in or | |
19 // out of fullscreen mode. | |
20 class ManagedFullScreenBubbleDelegateView | |
21 : public views::BubbleDelegateView, | |
22 public content::NotificationObserver { | |
23 public: | |
24 ManagedFullScreenBubbleDelegateView(views::View* anchor_view, | |
25 content::WebContents* web_contents); | |
26 ~ManagedFullScreenBubbleDelegateView() override; | |
27 | |
28 // content::NotificationObserver: | |
29 void Observe(int type, | |
30 const content::NotificationSource& source, | |
31 const content::NotificationDetails& details) override; | |
32 | |
33 protected: | |
34 // If the bubble is not anchored to a view, places the bubble in the top right | |
35 // (left in RTL) of the |screen_bounds| that contain web contents's browser | |
36 // window. Because the positioning is based on the size of the bubble, this | |
37 // must be called after the bubble is created. | |
38 virtual void AdjustForFullscreen(const gfx::Rect& screen_bounds); | |
Peter Kasting
2014/12/23 00:49:02
Why is this virtual? No subclass overrides it AFA
Pritam Nikam
2014/12/23 06:22:29
Done.
Kept as non-virtual protected method (calle
| |
39 | |
40 // Closes the bubble. | |
41 virtual void Close(); | |
42 | |
43 private: | |
44 // Used to register for fullscreen change notifications. | |
45 content::NotificationRegistrar registrar_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(ManagedFullScreenBubbleDelegateView); | |
48 }; | |
49 | |
50 #endif // CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ | |
OLD | NEW |