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_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" | 10 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Returns whether we are currently in a Metro snap view. | 67 // Returns whether we are currently in a Metro snap view. |
68 bool IsInMetroSnapMode(); | 68 bool IsInMetroSnapMode(); |
69 | 69 |
70 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
71 // API that puts the window into a mode suitable for rendering when Chrome | 71 // API that puts the window into a mode suitable for rendering when Chrome |
72 // is rendered in a 20% screen-width Metro snap view on Windows 8. | 72 // is rendered in a 20% screen-width Metro snap view on Windows 8. |
73 void SetMetroSnapMode(bool enable); | 73 void SetMetroSnapMode(bool enable); |
74 #endif | 74 #endif |
75 | 75 |
76 #if defined(OS_MACOSX) | 76 #if defined(OS_MACOSX) |
77 void TogglePresentationMode(); | 77 void ToggleFullscreenWithChrome(); |
78 #endif | 78 #endif |
79 | 79 |
80 // Mouse Lock //////////////////////////////////////////////////////////////// | 80 // Mouse Lock //////////////////////////////////////////////////////////////// |
81 | 81 |
82 bool IsMouseLockRequested() const; | 82 bool IsMouseLockRequested() const; |
83 bool IsMouseLocked() const; | 83 bool IsMouseLocked() const; |
84 | 84 |
85 void RequestToLockMouse(content::WebContents* web_contents, | 85 void RequestToLockMouse(content::WebContents* web_contents, |
86 bool user_gesture, | 86 bool user_gesture, |
87 bool last_unlocked_by_target); | 87 bool last_unlocked_by_target); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 MOUSELOCK_NOT_REQUESTED, | 123 MOUSELOCK_NOT_REQUESTED, |
124 // The page requests to lock the mouse and the user hasn't responded to the | 124 // The page requests to lock the mouse and the user hasn't responded to the |
125 // request. | 125 // request. |
126 MOUSELOCK_REQUESTED, | 126 MOUSELOCK_REQUESTED, |
127 // Mouse lock has been allowed by the user. | 127 // Mouse lock has been allowed by the user. |
128 MOUSELOCK_ACCEPTED, | 128 MOUSELOCK_ACCEPTED, |
129 // Mouse lock has been silently accepted, no notification to user. | 129 // Mouse lock has been silently accepted, no notification to user. |
130 MOUSELOCK_ACCEPTED_SILENTLY | 130 MOUSELOCK_ACCEPTED_SILENTLY |
131 }; | 131 }; |
132 | 132 |
| 133 enum FullscreenInternalOption { |
| 134 BROWSER, |
| 135 #if defined(OS_MACOSX) |
| 136 BROWSER_WITH_CHROME, |
| 137 #endif |
| 138 TAB |
| 139 }; |
| 140 |
133 void UpdateNotificationRegistrations(); | 141 void UpdateNotificationRegistrations(); |
134 | 142 |
135 // Posts a task to call NotifyFullscreenChange. | 143 // Posts a task to call NotifyFullscreenChange. |
136 void PostFullscreenChangeNotification(bool is_fullscreen); | 144 void PostFullscreenChangeNotification(bool is_fullscreen); |
137 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. | 145 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. |
138 void NotifyFullscreenChange(bool is_fullscreen); | 146 void NotifyFullscreenChange(bool is_fullscreen); |
139 // Notifies the tab that it has been forced out of fullscreen and mouse lock | 147 // Notifies the tab that it has been forced out of fullscreen and mouse lock |
140 // mode if necessary. | 148 // mode if necessary. |
141 void NotifyTabOfExitIfNecessary(); | 149 void NotifyTabOfExitIfNecessary(); |
142 void NotifyMouseLockChange(); | 150 void NotifyMouseLockChange(); |
143 | 151 |
144 // TODO(koz): Change |for_tab| to an enum. | 152 void ToggleFullscreenModeInternal(FullscreenInternalOption option); |
145 void ToggleFullscreenModeInternal(bool for_tab); | 153 void EnterFullscreenModeInternal(FullscreenInternalOption option); |
146 #if defined(OS_MACOSX) | 154 void ExitFullscreenModeInternal(); |
147 void TogglePresentationModeInternal(bool for_tab); | |
148 #endif | |
149 void SetFullscreenedTab(content::WebContents* tab); | 155 void SetFullscreenedTab(content::WebContents* tab); |
150 void SetMouseLockTab(content::WebContents* tab); | 156 void SetMouseLockTab(content::WebContents* tab); |
151 | 157 |
152 // Make the current tab exit fullscreen mode or mouse lock if it is in it. | 158 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
153 void ExitTabFullscreenOrMouseLockIfNecessary(); | 159 void ExitTabFullscreenOrMouseLockIfNecessary(); |
154 void UpdateFullscreenExitBubbleContent(); | 160 void UpdateFullscreenExitBubbleContent(); |
155 | 161 |
156 ContentSetting GetFullscreenSetting(const GURL& url) const; | 162 ContentSetting GetFullscreenSetting(const GURL& url) const; |
157 ContentSetting GetMouseLockSetting(const GURL& url) const; | 163 ContentSetting GetMouseLockSetting(const GURL& url) const; |
158 | 164 |
(...skipping 29 matching lines...) Expand all Loading... |
188 content::NotificationRegistrar registrar_; | 194 content::NotificationRegistrar registrar_; |
189 | 195 |
190 // Used to verify that calls we expect to reenter by calling | 196 // Used to verify that calls we expect to reenter by calling |
191 // WindowFullscreenStateChanged do so. | 197 // WindowFullscreenStateChanged do so. |
192 bool reentrant_window_state_change_call_check_; | 198 bool reentrant_window_state_change_call_check_; |
193 | 199 |
194 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 200 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
195 }; | 201 }; |
196 | 202 |
197 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 203 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
OLD | NEW |