Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash.h

Issue 2277563002: Wires up immersive mode for chrome and mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 { 19 namespace aura {
20 class Window; 20 class Window;
21 } 21 }
22 22
23 // See ash/mus/frame/README.me for description of how immersive mode works in
James Cook 2016/08/24 19:56:30 .me -> .md
sky 2016/08/24 20:11:14 Done.
24 // mash. This code works with both classic ash, and mash.
23 class ImmersiveModeControllerAsh 25 class ImmersiveModeControllerAsh
24 : public ImmersiveModeController, 26 : public ImmersiveModeController,
25 public ash::ImmersiveFullscreenControllerDelegate, 27 public ash::ImmersiveFullscreenControllerDelegate,
26 public ash::wm::WindowStateObserver, 28 public ash::wm::WindowStateObserver,
27 public content::NotificationObserver { 29 public content::NotificationObserver {
28 public: 30 public:
29 ImmersiveModeControllerAsh(); 31 ImmersiveModeControllerAsh();
30 ~ImmersiveModeControllerAsh() override; 32 ~ImmersiveModeControllerAsh() override;
31 33
32 ash::ImmersiveFullscreenController* controller() { return controller_.get(); } 34 ash::ImmersiveFullscreenController* controller() { return controller_.get(); }
(...skipping 17 matching lines...) Expand all
50 // tab fullscreen. 52 // tab fullscreen.
51 void EnableWindowObservers(bool enable); 53 void EnableWindowObservers(bool enable);
52 54
53 // Updates the browser root view's layout including window caption controls. 55 // Updates the browser root view's layout including window caption controls.
54 void LayoutBrowserRootView(); 56 void LayoutBrowserRootView();
55 57
56 // Updates whether the tab strip is painted in a short "light bar" style. 58 // 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. 59 // Returns true if the visibility of the tab indicators has changed.
58 bool UpdateTabIndicators(); 60 bool UpdateTabIndicators();
59 61
62 // Used when running in mash to create |mash_reveal_widget_|. Does nothing
63 // if already null.
64 void CreateMashRevealWidget();
65
66 // Destroys |mash_reveal_widget_| if valid, does nothing otherwise.
67 void DestroyMashRevealWidget();
68
60 // ImmersiveFullscreenController::Delegate overrides: 69 // ImmersiveFullscreenController::Delegate overrides:
61 void OnImmersiveRevealStarted() override; 70 void OnImmersiveRevealStarted() override;
62 void OnImmersiveRevealEnded() override; 71 void OnImmersiveRevealEnded() override;
63 void OnImmersiveFullscreenExited() override; 72 void OnImmersiveFullscreenExited() override;
64 void SetVisibleFraction(double visible_fraction) override; 73 void SetVisibleFraction(double visible_fraction) override;
65 std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override; 74 std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override;
66 75
67 // ash::wm::WindowStateObserver override: 76 // ash::wm::WindowStateObserver override:
68 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, 77 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state,
69 ash::wm::WindowStateType old_type) override; 78 ash::wm::WindowStateType old_type) override;
(...skipping 20 matching lines...) Expand all
90 99
91 // The current visible bounds of the find bar, in screen coordinates. This is 100 // The current visible bounds of the find bar, in screen coordinates. This is
92 // an empty rect if the find bar is not visible. 101 // an empty rect if the find bar is not visible.
93 gfx::Rect find_bar_visible_bounds_in_screen_; 102 gfx::Rect find_bar_visible_bounds_in_screen_;
94 103
95 // The fraction of the TopContainerView's height which is visible. Zero when 104 // The fraction of the TopContainerView's height which is visible. Zero when
96 // the top-of-window views are not revealed regardless of 105 // the top-of-window views are not revealed regardless of
97 // |use_tab_indicators_|. 106 // |use_tab_indicators_|.
98 double visible_fraction_; 107 double visible_fraction_;
99 108
109 // When running in mash a widget is created to draw the top container. This
110 // widget does not actually contain the top container, it just renders it.
111 std::unique_ptr<views::Widget> mash_reveal_widget_;
112
100 content::NotificationRegistrar registrar_; 113 content::NotificationRegistrar registrar_;
101 114
102 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh); 115 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeControllerAsh);
103 }; 116 };
104 117
105 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_ 118 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_ASH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698