OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/common/wm/window_state_observer.h" | 10 #include "ash/common/wm/window_state_observer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 public: | 32 public: |
33 ImmersiveModeControllerAsh(); | 33 ImmersiveModeControllerAsh(); |
34 ~ImmersiveModeControllerAsh() override; | 34 ~ImmersiveModeControllerAsh() override; |
35 | 35 |
36 ash::ImmersiveFullscreenController* controller() { return controller_.get(); } | 36 ash::ImmersiveFullscreenController* controller() { return controller_.get(); } |
37 | 37 |
38 // ImmersiveModeController overrides: | 38 // ImmersiveModeController overrides: |
39 void Init(BrowserView* browser_view) override; | 39 void Init(BrowserView* browser_view) override; |
40 void SetEnabled(bool enabled) override; | 40 void SetEnabled(bool enabled) override; |
41 bool IsEnabled() const override; | 41 bool IsEnabled() const override; |
42 bool ShouldHideTabIndicators() const override; | |
43 bool ShouldHideTopViews() const override; | 42 bool ShouldHideTopViews() const override; |
44 bool IsRevealed() const override; | 43 bool IsRevealed() const override; |
45 int GetTopContainerVerticalOffset( | 44 int GetTopContainerVerticalOffset( |
46 const gfx::Size& top_container_size) const override; | 45 const gfx::Size& top_container_size) const override; |
47 ImmersiveRevealedLock* GetRevealedLock(AnimateReveal animate_reveal) override | 46 ImmersiveRevealedLock* GetRevealedLock(AnimateReveal animate_reveal) override |
48 WARN_UNUSED_RESULT; | 47 WARN_UNUSED_RESULT; |
49 void OnFindBarVisibleBoundsChanged( | 48 void OnFindBarVisibleBoundsChanged( |
50 const gfx::Rect& new_visible_bounds_in_screen) override; | 49 const gfx::Rect& new_visible_bounds_in_screen) override; |
51 views::Widget* GetRevealWidget() override; | 50 views::Widget* GetRevealWidget() override; |
52 | 51 |
53 private: | 52 private: |
54 // Enables or disables observers for window restore and entering / exiting | 53 // Enables or disables observers for window restore and entering / exiting |
55 // tab fullscreen. | 54 // tab fullscreen. |
56 void EnableWindowObservers(bool enable); | 55 void EnableWindowObservers(bool enable); |
57 | 56 |
58 // Updates the browser root view's layout including window caption controls. | 57 // Updates the browser root view's layout including window caption controls. |
59 void LayoutBrowserRootView(); | 58 void LayoutBrowserRootView(); |
60 | 59 |
61 // Updates whether the tab strip is painted in a short "light bar" style. | |
62 // Returns true if the visibility of the tab indicators has changed. | |
63 bool UpdateTabIndicators(); | |
64 | |
65 // Used when running in mash to create |mash_reveal_widget_|. Does nothing | 60 // Used when running in mash to create |mash_reveal_widget_|. Does nothing |
66 // if already null. | 61 // if already null. |
67 void CreateMashRevealWidget(); | 62 void CreateMashRevealWidget(); |
68 | 63 |
69 // Destroys |mash_reveal_widget_| if valid, does nothing otherwise. | 64 // Destroys |mash_reveal_widget_| if valid, does nothing otherwise. |
70 void DestroyMashRevealWidget(); | 65 void DestroyMashRevealWidget(); |
71 | 66 |
72 // ImmersiveFullscreenController::Delegate overrides: | 67 // ImmersiveFullscreenController::Delegate overrides: |
73 void OnImmersiveRevealStarted() override; | 68 void OnImmersiveRevealStarted() override; |
74 void OnImmersiveRevealEnded() override; | 69 void OnImmersiveRevealEnded() override; |
(...skipping 18 matching lines...) Expand all Loading... |
93 std::unique_ptr<ash::ImmersiveFullscreenController> controller_; | 88 std::unique_ptr<ash::ImmersiveFullscreenController> controller_; |
94 | 89 |
95 // Not owned. | 90 // Not owned. |
96 BrowserView* browser_view_; | 91 BrowserView* browser_view_; |
97 aura::Window* native_window_; | 92 aura::Window* native_window_; |
98 | 93 |
99 // True if the observers for window restore and entering / exiting tab | 94 // True if the observers for window restore and entering / exiting tab |
100 // fullscreen are enabled. | 95 // fullscreen are enabled. |
101 bool observers_enabled_; | 96 bool observers_enabled_; |
102 | 97 |
103 // Whether a short "light bar" version of the tab strip should be painted when | |
104 // the top-of-window views are closed. If |use_tab_indicators_| is false, the | |
105 // tab strip is not painted at all when the top-of-window views are closed. | |
106 bool use_tab_indicators_; | |
107 | |
108 // The current visible bounds of the find bar, in screen coordinates. This is | 98 // The current visible bounds of the find bar, in screen coordinates. This is |
109 // an empty rect if the find bar is not visible. | 99 // an empty rect if the find bar is not visible. |
110 gfx::Rect find_bar_visible_bounds_in_screen_; | 100 gfx::Rect find_bar_visible_bounds_in_screen_; |
111 | 101 |
112 // The fraction of the TopContainerView's height which is visible. Zero when | 102 // The fraction of the TopContainerView's height which is visible. Zero when |
113 // the top-of-window views are not revealed regardless of | 103 // the top-of-window views are not revealed. |
114 // |use_tab_indicators_|. | |
115 double visible_fraction_; | 104 double visible_fraction_; |
116 | 105 |
117 // When running in mash a widget is created to draw the top container. This | 106 // When running in mash a widget is created to draw the top container. This |
118 // widget does not actually contain the top container, it just renders it. | 107 // widget does not actually contain the top container, it just renders it. |
119 std::unique_ptr<views::Widget> mash_reveal_widget_; | 108 std::unique_ptr<views::Widget> mash_reveal_widget_; |
120 | 109 |
121 content::NotificationRegistrar registrar_; | 110 content::NotificationRegistrar registrar_; |
122 | 111 |
123 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh); | 112 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh); |
124 }; | 113 }; |
125 | 114 |
126 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ | 115 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ |
OLD | NEW |