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" |
11 #include "ash/shared/immersive_fullscreen_controller.h" | 11 #include "ash/shared/immersive_fullscreen_controller.h" |
12 #include "ash/shared/immersive_fullscreen_controller_delegate.h" | 12 #include "ash/shared/immersive_fullscreen_controller_delegate.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 14 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
18 | 18 |
19 namespace aura { | |
20 class Window; | |
21 } | |
22 | |
23 class ImmersiveModeControllerAsh | 19 class ImmersiveModeControllerAsh |
James Cook
2016/08/24 17:00:32
I think the commentary from your CL description sh
sky
2016/08/24 19:23:29
I went with a markdown file in ash/mus/frame for t
James Cook
2016/08/24 19:56:29
I like it.
| |
24 : public ImmersiveModeController, | 20 : public ImmersiveModeController, |
25 public ash::ImmersiveFullscreenControllerDelegate, | 21 public ash::ImmersiveFullscreenControllerDelegate, |
26 public ash::wm::WindowStateObserver, | 22 public ash::wm::WindowStateObserver, |
27 public content::NotificationObserver { | 23 public content::NotificationObserver { |
28 public: | 24 public: |
29 ImmersiveModeControllerAsh(); | 25 ImmersiveModeControllerAsh(); |
30 ~ImmersiveModeControllerAsh() override; | 26 ~ImmersiveModeControllerAsh() override; |
31 | 27 |
32 ash::ImmersiveFullscreenController* controller() { return controller_.get(); } | 28 ash::ImmersiveFullscreenController* controller() { return controller_.get(); } |
33 | 29 |
(...skipping 16 matching lines...) Expand all Loading... | |
50 // tab fullscreen. | 46 // tab fullscreen. |
51 void EnableWindowObservers(bool enable); | 47 void EnableWindowObservers(bool enable); |
52 | 48 |
53 // Updates the browser root view's layout including window caption controls. | 49 // Updates the browser root view's layout including window caption controls. |
54 void LayoutBrowserRootView(); | 50 void LayoutBrowserRootView(); |
55 | 51 |
56 // Updates whether the tab strip is painted in a short "light bar" style. | 52 // Updates whether the tab strip is painted in a short "light bar" style. |
57 // Returns true if the visibility of the tab indicators has changed. | 53 // Returns true if the visibility of the tab indicators has changed. |
58 bool UpdateTabIndicators(); | 54 bool UpdateTabIndicators(); |
59 | 55 |
56 // Used when running in mash to create |mash_reveal_widget_|. Does nothing | |
57 // if already null. | |
58 void CreateMashRevealWidget(); | |
59 | |
60 // Destroys |mash_reveal_widget_| if valid, does nothing otherwise. | |
61 void DestroyMashRevealWidget(); | |
62 | |
60 // ImmersiveFullscreenController::Delegate overrides: | 63 // ImmersiveFullscreenController::Delegate overrides: |
61 void OnImmersiveRevealStarted() override; | 64 void OnImmersiveRevealStarted() override; |
62 void OnImmersiveRevealEnded() override; | 65 void OnImmersiveRevealEnded() override; |
63 void OnImmersiveFullscreenExited() override; | 66 void OnImmersiveFullscreenExited() override; |
64 void SetVisibleFraction(double visible_fraction) override; | 67 void SetVisibleFraction(double visible_fraction) override; |
65 std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override; | 68 std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override; |
66 | 69 |
67 // ash::wm::WindowStateObserver override: | 70 // ash::wm::WindowStateObserver override: |
68 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, | 71 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, |
69 ash::wm::WindowStateType old_type) override; | 72 ash::wm::WindowStateType old_type) override; |
70 | 73 |
71 // content::NotificationObserver override: | 74 // content::NotificationObserver override: |
72 void Observe(int type, | 75 void Observe(int type, |
73 const content::NotificationSource& source, | 76 const content::NotificationSource& source, |
74 const content::NotificationDetails& details) override; | 77 const content::NotificationDetails& details) override; |
75 | 78 |
76 std::unique_ptr<ash::ImmersiveFullscreenController> controller_; | 79 std::unique_ptr<ash::ImmersiveFullscreenController> controller_; |
77 | 80 |
78 // Not owned. | 81 // Not owned. |
79 BrowserView* browser_view_; | 82 BrowserView* browser_view_; |
80 aura::Window* native_window_; | |
81 | 83 |
82 // True if the observers for window restore and entering / exiting tab | 84 // True if the observers for window restore and entering / exiting tab |
83 // fullscreen are enabled. | 85 // fullscreen are enabled. |
84 bool observers_enabled_; | 86 bool observers_enabled_; |
85 | 87 |
86 // Whether a short "light bar" version of the tab strip should be painted when | 88 // Whether a short "light bar" version of the tab strip should be painted when |
87 // the top-of-window views are closed. If |use_tab_indicators_| is false, the | 89 // the top-of-window views are closed. If |use_tab_indicators_| is false, the |
88 // tab strip is not painted at all when the top-of-window views are closed. | 90 // tab strip is not painted at all when the top-of-window views are closed. |
89 bool use_tab_indicators_; | 91 bool use_tab_indicators_; |
90 | 92 |
91 // The current visible bounds of the find bar, in screen coordinates. This is | 93 // The current visible bounds of the find bar, in screen coordinates. This is |
92 // an empty rect if the find bar is not visible. | 94 // an empty rect if the find bar is not visible. |
93 gfx::Rect find_bar_visible_bounds_in_screen_; | 95 gfx::Rect find_bar_visible_bounds_in_screen_; |
94 | 96 |
95 // The fraction of the TopContainerView's height which is visible. Zero when | 97 // The fraction of the TopContainerView's height which is visible. Zero when |
96 // the top-of-window views are not revealed regardless of | 98 // the top-of-window views are not revealed regardless of |
97 // |use_tab_indicators_|. | 99 // |use_tab_indicators_|. |
98 double visible_fraction_; | 100 double visible_fraction_; |
99 | 101 |
102 // When running in mash a widget is created to draw the top container. This | |
103 // widget does not actually contain the top container, it just renders it. | |
104 std::unique_ptr<views::Widget> mash_reveal_widget_; | |
105 | |
100 content::NotificationRegistrar registrar_; | 106 content::NotificationRegistrar registrar_; |
101 | 107 |
102 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh); | 108 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh); |
103 }; | 109 }; |
104 | 110 |
105 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ | 111 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ |
OLD | NEW |