| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void UpdateContent(const GURL& url, ExclusiveAccessBubbleType bubble_type); | 40 void UpdateContent(const GURL& url, ExclusiveAccessBubbleType bubble_type); |
| 41 | 41 |
| 42 // Repositions |popup_| if it is visible. | 42 // Repositions |popup_| if it is visible. |
| 43 void RepositionIfVisible(); | 43 void RepositionIfVisible(); |
| 44 | 44 |
| 45 views::View* GetView(); | 45 views::View* GetView(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 class ExclusiveAccessView; | 48 class ExclusiveAccessView; |
| 49 | 49 |
| 50 enum AnimatedAttribute { | |
| 51 ANIMATED_ATTRIBUTE_BOUNDS, | |
| 52 ANIMATED_ATTRIBUTE_OPACITY | |
| 53 }; | |
| 54 | |
| 55 // Returns the expected animated attribute based on flags and bubble type. | |
| 56 AnimatedAttribute ExpectedAnimationAttribute(); | |
| 57 | |
| 58 // Starts or stops polling the mouse location based on |popup_| and | 50 // Starts or stops polling the mouse location based on |popup_| and |
| 59 // |bubble_type_|. | 51 // |bubble_type_|. |
| 60 void UpdateMouseWatcher(); | 52 void UpdateMouseWatcher(); |
| 61 | 53 |
| 62 // Updates any state which depends on whether the user is in immersive | |
| 63 // fullscreen. | |
| 64 void UpdateForImmersiveState(); | |
| 65 | |
| 66 // Updates |popup|'s bounds given |animation_| and |animated_attribute_|. | 54 // Updates |popup|'s bounds given |animation_| and |animated_attribute_|. |
| 67 void UpdateBounds(); | 55 void UpdateBounds(); |
| 68 | 56 |
| 69 // Returns the root view containing |browser_view_|. | 57 // Returns the root view containing |browser_view_|. |
| 70 views::View* GetBrowserRootView() const; | 58 views::View* GetBrowserRootView() const; |
| 71 | 59 |
| 72 // ExclusiveAccessBubble overrides: | 60 // ExclusiveAccessBubble overrides: |
| 73 void AnimationProgressed(const gfx::Animation* animation) override; | 61 void AnimationProgressed(const gfx::Animation* animation) override; |
| 74 void AnimationEnded(const gfx::Animation* animation) override; | 62 void AnimationEnded(const gfx::Animation* animation) override; |
| 75 gfx::Rect GetPopupRect(bool ignore_animation_state) const override; | 63 gfx::Rect GetPopupRect(bool ignore_animation_state) const override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 89 // views::WidgetObserver override: | 77 // views::WidgetObserver override: |
| 90 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 78 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| 91 | 79 |
| 92 ExclusiveAccessBubbleViewsContext* const bubble_view_context_; | 80 ExclusiveAccessBubbleViewsContext* const bubble_view_context_; |
| 93 | 81 |
| 94 views::Widget* popup_; | 82 views::Widget* popup_; |
| 95 | 83 |
| 96 // Animation controlling showing/hiding of the exit bubble. | 84 // Animation controlling showing/hiding of the exit bubble. |
| 97 std::unique_ptr<gfx::SlideAnimation> animation_; | 85 std::unique_ptr<gfx::SlideAnimation> animation_; |
| 98 | 86 |
| 99 // Attribute animated by |animation_|. | |
| 100 AnimatedAttribute animated_attribute_; | |
| 101 | |
| 102 // The contents of the popup. | 87 // The contents of the popup. |
| 103 ExclusiveAccessView* view_; | 88 ExclusiveAccessView* view_; |
| 104 | 89 |
| 105 content::NotificationRegistrar registrar_; | 90 content::NotificationRegistrar registrar_; |
| 106 | 91 |
| 107 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubbleViews); | 92 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubbleViews); |
| 108 }; | 93 }; |
| 109 | 94 |
| 110 #endif // CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ | 95 #endif // CHROME_BROWSER_UI_VIEWS_EXCLUSIVE_ACCESS_BUBBLE_VIEWS_H_ |
| OLD | NEW |