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 namespace views { | |
19 class View; | |
vasilii
2014/12/18 16:16:22
it's already included.
Pritam Nikam
2014/12/19 09:16:54
Done.
| |
20 } | |
21 | |
22 // View used to display the bubble popup and manages the browser's full screen | |
23 // 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.
| |
24 class ManagedFullScreenBubbleDelegateView | |
25 : public views::BubbleDelegateView, | |
26 public content::NotificationObserver { | |
27 public: | |
28 ManagedFullScreenBubbleDelegateView(views::View* anchor_view, | |
29 content::WebContents* web_contents); | |
30 ~ManagedFullScreenBubbleDelegateView() override; | |
31 | |
32 // content::NotificationObserver: | |
33 void Observe(int type, | |
34 const content::NotificationSource& source, | |
35 const content::NotificationDetails& details) override; | |
36 | |
37 protected: | |
38 // If the bubble is not anchored to a view, places the bubble in the top | |
39 // right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s | |
40 // browser window. Because the positioning is based on the size of the | |
41 // bubble, this must be called after the bubble is created. | |
42 void AdjustForFullscreen(const gfx::Rect& screen_bounds); | |
43 | |
44 // views::View: | |
45 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | |
46 | |
47 // Close the bubble. | |
48 virtual void Close(); | |
49 | |
50 private: | |
51 // Used to register for fullscreen change notifications. | |
52 content::NotificationRegistrar registrar_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(ManagedFullScreenBubbleDelegateView); | |
55 }; | |
56 | |
57 #endif // CHROME_BROWSER_UI_VIEWS_MANAGED_FULL_SCREEN_BUBBLE_DELEGATE_VIEW_H_ | |
OLD | NEW |