| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" | 10 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "ui/views/widget/widget_observer.h" | 13 #include "ui/views/widget/widget_observer.h" |
| 14 | 14 |
| 15 class BrowserView; | 15 class ExclusiveAccessBubbleViewsContext; |
| 16 class GURL; | 16 class GURL; |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class SlideAnimation; | 18 class SlideAnimation; |
| 19 } | 19 } |
| 20 namespace views { | 20 namespace views { |
| 21 class View; | 21 class View; |
| 22 class Widget; | 22 class Widget; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // ExclusiveAccessBubbleViews is responsible for showing a bubble atop the | 25 // ExclusiveAccessBubbleViews is responsible for showing a bubble atop the |
| 26 // screen in fullscreen/mouse lock mode, telling users how to exit and providing | 26 // screen in fullscreen/mouse lock mode, telling users how to exit and providing |
| 27 // a click target. The bubble auto-hides, and re-shows when the user moves to | 27 // a click target. The bubble auto-hides, and re-shows when the user moves to |
| 28 // the screen top. | 28 // the screen top. |
| 29 class ExclusiveAccessBubbleViews : public ExclusiveAccessBubble, | 29 class ExclusiveAccessBubbleViews : public ExclusiveAccessBubble, |
| 30 public content::NotificationObserver, | 30 public content::NotificationObserver, |
| 31 public views::WidgetObserver { | 31 public views::WidgetObserver { |
| 32 public: | 32 public: |
| 33 ExclusiveAccessBubbleViews(BrowserView* browser, | 33 ExclusiveAccessBubbleViews(ExclusiveAccessBubbleViewsContext* context, |
| 34 const GURL& url, | 34 const GURL& url, |
| 35 ExclusiveAccessBubbleType bubble_type); | 35 ExclusiveAccessBubbleType bubble_type); |
| 36 ~ExclusiveAccessBubbleViews() override; | 36 ~ExclusiveAccessBubbleViews() override; |
| 37 | 37 |
| 38 void UpdateContent(const GURL& url, ExclusiveAccessBubbleType bubble_type); | 38 void UpdateContent(const GURL& url, ExclusiveAccessBubbleType bubble_type); |
| 39 | 39 |
| 40 // Repositions |popup_| if it is visible. | 40 // Repositions |popup_| if it is visible. |
| 41 void RepositionIfVisible(); | 41 void RepositionIfVisible(); |
| 42 | 42 |
| 43 private: | 43 private: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool CanMouseTriggerSlideIn() const override; | 75 bool CanMouseTriggerSlideIn() const override; |
| 76 | 76 |
| 77 // content::NotificationObserver override: | 77 // content::NotificationObserver override: |
| 78 void Observe(int type, | 78 void Observe(int type, |
| 79 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
| 80 const content::NotificationDetails& details) override; | 80 const content::NotificationDetails& details) override; |
| 81 | 81 |
| 82 // views::WidgetObserver override: | 82 // views::WidgetObserver override: |
| 83 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 83 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| 84 | 84 |
| 85 BrowserView* browser_view_; | 85 ExclusiveAccessBubbleViewsContext* bubble_view_context_; |
| 86 | 86 |
| 87 views::Widget* popup_; | 87 views::Widget* popup_; |
| 88 | 88 |
| 89 // Animation controlling showing/hiding of the exit bubble. | 89 // Animation controlling showing/hiding of the exit bubble. |
| 90 scoped_ptr<gfx::SlideAnimation> animation_; | 90 scoped_ptr<gfx::SlideAnimation> animation_; |
| 91 | 91 |
| 92 // Attribute animated by |animation_|. | 92 // Attribute animated by |animation_|. |
| 93 AnimatedAttribute animated_attribute_; | 93 AnimatedAttribute animated_attribute_; |
| 94 | 94 |
| 95 // The contents of the popup. | 95 // The contents of the popup. |
| 96 ExclusiveAccessView* view_; | 96 ExclusiveAccessView* view_; |
| 97 | 97 |
| 98 content::NotificationRegistrar registrar_; | 98 content::NotificationRegistrar registrar_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubbleViews); | 100 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubbleViews); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ |
| OLD | NEW |