OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_IMMERSIVE_MODE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_IMMERSIVE_MODE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_IMMERSIVE_MODE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_IMMERSIVE_MODE_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Enables or disables immersive mode. | 32 // Enables or disables immersive mode. |
33 void SetEnabled(bool enabled); | 33 void SetEnabled(bool enabled); |
34 bool enabled() const { return enabled_; } | 34 bool enabled() const { return enabled_; } |
35 | 35 |
36 // True when we are hiding the top views due to immersive mode. | 36 // True when we are hiding the top views due to immersive mode. |
37 bool ShouldHideTopViews() const { return enabled_ && !revealed_; } | 37 bool ShouldHideTopViews() const { return enabled_ && !revealed_; } |
38 | 38 |
39 bool IsRevealed() const { return enabled_ && revealed_; } | 39 bool IsRevealed() const { return enabled_ && revealed_; } |
40 | 40 |
41 // ui::EventHandler overrides: | 41 // ui::EventHandler overrides: |
42 virtual ui::EventResult OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | |
43 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 42 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
44 virtual ui::EventResult OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; | |
45 virtual ui::EventResult OnTouchEvent(ui::TouchEvent* event) OVERRIDE; | |
46 virtual ui::EventResult OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
47 | 43 |
48 // ui::ImplicitAnimationObserver overrides: | 44 // ui::ImplicitAnimationObserver overrides: |
49 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 45 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
50 | 46 |
51 // views::MouseWatcherListener overrides: | 47 // views::MouseWatcherListener overrides: |
52 virtual void MouseMovedOutOfHost() OVERRIDE; | 48 virtual void MouseMovedOutOfHost() OVERRIDE; |
53 | 49 |
54 // Testing interface. | 50 // Testing interface. |
55 void StartRevealForTest(); | 51 void StartRevealForTest(); |
56 void EndRevealForTest(); | 52 void EndRevealForTest(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 base::OneShotTimer<ImmersiveModeController> top_timer_; | 87 base::OneShotTimer<ImmersiveModeController> top_timer_; |
92 | 88 |
93 // Mouse watcher to detect when the cursor leaves the top-of-window views | 89 // Mouse watcher to detect when the cursor leaves the top-of-window views |
94 // in immersive mode, indicating that we should hide the views. | 90 // in immersive mode, indicating that we should hide the views. |
95 scoped_ptr<views::MouseWatcher> mouse_watcher_; | 91 scoped_ptr<views::MouseWatcher> mouse_watcher_; |
96 | 92 |
97 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeController); | 93 DISALLOW_COPY_AND_ASSIGN(ImmersiveModeController); |
98 }; | 94 }; |
99 | 95 |
100 #endif // CHROME_BROWSER_UI_VIEWS_IMMERSIVE_MODE_CONTROLLER_H_ | 96 #endif // CHROME_BROWSER_UI_VIEWS_IMMERSIVE_MODE_CONTROLLER_H_ |
OLD | NEW |