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

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

Issue 697223003: MacViews: Get chrome/browser/ui/views/frame to compile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@constrained
Patch Set: Rebase. Add mac_views_browser build flag Created 6 years, 1 month 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_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_
7 7
8 #include "ash/wm/immersive_revealed_lock.h"
9 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
10 #include "base/observer_list.h" 9 #include "base/observer_list.h"
11 #include "chrome/browser/ui/host_desktop.h" 10 #include "chrome/browser/ui/host_desktop.h"
12 11
13 class BrowserView; 12 class BrowserView;
14 13
15 namespace gfx { 14 namespace gfx {
16 class Rect; 15 class Rect;
17 class Size; 16 class Size;
18 } 17 }
19 18
20 typedef ash::ImmersiveRevealedLock ImmersiveRevealedLock; 19 // A lock which will keep the top-of-window views revealed for its
20 // lifetime.
21 // See ImmersiveModeController::GetRevealedLock for details.
22 class ImmersiveRevealedLock {
23 public:
24 virtual ~ImmersiveRevealedLock();
25
26 protected:
27 ImmersiveRevealedLock();
28
29 private:
30 DISALLOW_COPY_AND_ASSIGN(ImmersiveRevealedLock);
tapted 2014/11/04 02:33:43 I think you can turn this into a pure interface. W
Andre 2014/11/05 02:04:23 Done.
31 };
21 32
22 // Controller for an "immersive mode" similar to MacOS presentation mode where 33 // Controller for an "immersive mode" similar to MacOS presentation mode where
23 // the top-of-window views are hidden until the mouse hits the top of the 34 // the top-of-window views are hidden until the mouse hits the top of the
24 // screen. The tab strip is optionally painted with miniature "tab indicator" 35 // screen. The tab strip is optionally painted with miniature "tab indicator"
25 // rectangles. 36 // rectangles.
26 // Currently, immersive mode is only available for Chrome OS. 37 // Currently, immersive mode is only available for Chrome OS.
27 class ImmersiveModeController { 38 class ImmersiveModeController {
28 public: 39 public:
29 enum AnimateReveal { 40 enum AnimateReveal {
30 ANIMATE_REVEAL_YES, 41 ANIMATE_REVEAL_YES,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Returns a lock which will keep the top-of-window views revealed for its 86 // Returns a lock which will keep the top-of-window views revealed for its
76 // lifetime. Several locks can be obtained. When all of the locks are 87 // lifetime. Several locks can be obtained. When all of the locks are
77 // destroyed, if immersive mode is enabled and there is nothing else keeping 88 // destroyed, if immersive mode is enabled and there is nothing else keeping
78 // the top-of-window views revealed, the top-of-window views will be closed. 89 // the top-of-window views revealed, the top-of-window views will be closed.
79 // This method always returns a valid lock regardless of whether immersive 90 // This method always returns a valid lock regardless of whether immersive
80 // mode is enabled. The lock's lifetime can span immersive mode being 91 // mode is enabled. The lock's lifetime can span immersive mode being
81 // enabled / disabled. 92 // enabled / disabled.
82 // If acquiring the lock causes a reveal, the top-of-window views will animate 93 // If acquiring the lock causes a reveal, the top-of-window views will animate
83 // according to |animate_reveal|. 94 // according to |animate_reveal|.
84 // The caller takes ownership of the returned lock. 95 // The caller takes ownership of the returned lock.
96 // This is currently only supported on Ash.
85 virtual ImmersiveRevealedLock* GetRevealedLock( 97 virtual ImmersiveRevealedLock* GetRevealedLock(
tapted 2014/11/04 02:33:43 This should really be called `CreateRevealedLock`,
Andre 2014/11/05 02:04:23 I agree, but probably does not belong in this CL.
86 AnimateReveal animate_reveal) WARN_UNUSED_RESULT = 0; 98 AnimateReveal animate_reveal) WARN_UNUSED_RESULT = 0;
87 99
88 // Called by the find bar to indicate that its visible bounds have changed. 100 // Called by the find bar to indicate that its visible bounds have changed.
89 // |new_visible_bounds_in_screen| should be empty if the find bar is not 101 // |new_visible_bounds_in_screen| should be empty if the find bar is not
90 // visible. 102 // visible.
91 virtual void OnFindBarVisibleBoundsChanged( 103 virtual void OnFindBarVisibleBoundsChanged(
92 const gfx::Rect& new_visible_bounds_in_screen) = 0; 104 const gfx::Rect& new_visible_bounds_in_screen) = 0;
93 105
94 // Disables animations and moves the mouse so that it is not over the 106 // Disables animations and moves the mouse so that it is not over the
95 // top-of-window views for the sake of testing. Must be called before 107 // top-of-window views for the sake of testing. Must be called before
(...skipping 12 matching lines...) Expand all
108 120
109 namespace chrome { 121 namespace chrome {
110 122
111 // Implemented in immersive_mode_controller_factory.cc. 123 // Implemented in immersive_mode_controller_factory.cc.
112 ImmersiveModeController* CreateImmersiveModeController( 124 ImmersiveModeController* CreateImmersiveModeController(
113 chrome::HostDesktopType host_desktop_type); 125 chrome::HostDesktopType host_desktop_type);
114 126
115 } // namespace chrome 127 } // namespace chrome
116 128
117 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_ 129 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698