| 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_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" |
| 8 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 9 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 10 #include "chrome/browser/ui/host_desktop.h" | 11 #include "chrome/browser/ui/host_desktop.h" |
| 11 | 12 |
| 12 class BrowserView; | 13 class BrowserView; |
| 13 | 14 |
| 14 namespace gfx { | 15 namespace gfx { |
| 15 class Rect; | 16 class Rect; |
| 16 class Size; | 17 class Size; |
| 17 } | 18 } |
| 18 | 19 |
| 19 // A lock which will keep the top-of-window views revealed for its | 20 typedef ash::ImmersiveRevealedLock ImmersiveRevealedLock; |
| 20 // lifetime. | |
| 21 // See ImmersiveModeController::GetRevealedLock for details. | |
| 22 class ImmersiveRevealedLock { | |
| 23 public: | |
| 24 virtual ~ImmersiveRevealedLock() {} | |
| 25 | |
| 26 protected: | |
| 27 ImmersiveRevealedLock() {} | |
| 28 }; | |
| 29 | 21 |
| 30 // Controller for an "immersive mode" similar to MacOS presentation mode where | 22 // Controller for an "immersive mode" similar to MacOS presentation mode where |
| 31 // the top-of-window views are hidden until the mouse hits the top of the | 23 // the top-of-window views are hidden until the mouse hits the top of the |
| 32 // screen. The tab strip is optionally painted with miniature "tab indicator" | 24 // screen. The tab strip is optionally painted with miniature "tab indicator" |
| 33 // rectangles. | 25 // rectangles. |
| 34 // Currently, immersive mode is only available for Chrome OS. | 26 // Currently, immersive mode is only available for Chrome OS. |
| 35 class ImmersiveModeController { | 27 class ImmersiveModeController { |
| 36 public: | 28 public: |
| 37 enum AnimateReveal { | 29 enum AnimateReveal { |
| 38 ANIMATE_REVEAL_YES, | 30 ANIMATE_REVEAL_YES, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Returns a lock which will keep the top-of-window views revealed for its | 75 // Returns a lock which will keep the top-of-window views revealed for its |
| 84 // lifetime. Several locks can be obtained. When all of the locks are | 76 // lifetime. Several locks can be obtained. When all of the locks are |
| 85 // destroyed, if immersive mode is enabled and there is nothing else keeping | 77 // destroyed, if immersive mode is enabled and there is nothing else keeping |
| 86 // the top-of-window views revealed, the top-of-window views will be closed. | 78 // the top-of-window views revealed, the top-of-window views will be closed. |
| 87 // This method always returns a valid lock regardless of whether immersive | 79 // This method always returns a valid lock regardless of whether immersive |
| 88 // mode is enabled. The lock's lifetime can span immersive mode being | 80 // mode is enabled. The lock's lifetime can span immersive mode being |
| 89 // enabled / disabled. | 81 // enabled / disabled. |
| 90 // If acquiring the lock causes a reveal, the top-of-window views will animate | 82 // If acquiring the lock causes a reveal, the top-of-window views will animate |
| 91 // according to |animate_reveal|. | 83 // according to |animate_reveal|. |
| 92 // The caller takes ownership of the returned lock. | 84 // The caller takes ownership of the returned lock. |
| 93 // This is currently only supported on Ash. | |
| 94 virtual ImmersiveRevealedLock* GetRevealedLock( | 85 virtual ImmersiveRevealedLock* GetRevealedLock( |
| 95 AnimateReveal animate_reveal) WARN_UNUSED_RESULT = 0; | 86 AnimateReveal animate_reveal) WARN_UNUSED_RESULT = 0; |
| 96 | 87 |
| 97 // Called by the find bar to indicate that its visible bounds have changed. | 88 // Called by the find bar to indicate that its visible bounds have changed. |
| 98 // |new_visible_bounds_in_screen| should be empty if the find bar is not | 89 // |new_visible_bounds_in_screen| should be empty if the find bar is not |
| 99 // visible. | 90 // visible. |
| 100 virtual void OnFindBarVisibleBoundsChanged( | 91 virtual void OnFindBarVisibleBoundsChanged( |
| 101 const gfx::Rect& new_visible_bounds_in_screen) = 0; | 92 const gfx::Rect& new_visible_bounds_in_screen) = 0; |
| 102 | 93 |
| 103 // Disables animations and moves the mouse so that it is not over the | 94 // Disables animations and moves the mouse so that it is not over the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 117 | 108 |
| 118 namespace chrome { | 109 namespace chrome { |
| 119 | 110 |
| 120 // Implemented in immersive_mode_controller_factory.cc. | 111 // Implemented in immersive_mode_controller_factory.cc. |
| 121 ImmersiveModeController* CreateImmersiveModeController( | 112 ImmersiveModeController* CreateImmersiveModeController( |
| 122 chrome::HostDesktopType host_desktop_type); | 113 chrome::HostDesktopType host_desktop_type); |
| 123 | 114 |
| 124 } // namespace chrome | 115 } // namespace chrome |
| 125 | 116 |
| 126 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_ | 117 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_IMMERSIVE_MODE_CONTROLLER_H_ |
| OLD | NEW |