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 ToggleFullscreenWithChrome(); | 77 void TogglePresentationMode(); |
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 | |
141 void UpdateNotificationRegistrations(); | 133 void UpdateNotificationRegistrations(); |
142 | 134 |
143 // Posts a task to call NotifyFullscreenChange. | 135 // Posts a task to call NotifyFullscreenChange. |
144 void PostFullscreenChangeNotification(bool is_fullscreen); | 136 void PostFullscreenChangeNotification(bool is_fullscreen); |
145 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. | 137 // Sends a NOTIFICATION_FULLSCREEN_CHANGED notification. |
146 void NotifyFullscreenChange(bool is_fullscreen); | 138 void NotifyFullscreenChange(bool is_fullscreen); |
147 // Notifies the tab that it has been forced out of fullscreen and mouse lock | 139 // Notifies the tab that it has been forced out of fullscreen and mouse lock |
148 // mode if necessary. | 140 // mode if necessary. |
149 void NotifyTabOfExitIfNecessary(); | 141 void NotifyTabOfExitIfNecessary(); |
150 void NotifyMouseLockChange(); | 142 void NotifyMouseLockChange(); |
151 | 143 |
152 void ToggleFullscreenModeInternal(FullscreenInternalOption option); | 144 // TODO(koz): Change |for_tab| to an enum. |
153 void EnterFullscreenModeInternal(FullscreenInternalOption option); | 145 void ToggleFullscreenModeInternal(bool for_tab); |
154 void ExitFullscreenModeInternal(); | 146 #if defined(OS_MACOSX) |
| 147 void TogglePresentationModeInternal(bool for_tab); |
| 148 #endif |
155 void SetFullscreenedTab(content::WebContents* tab); | 149 void SetFullscreenedTab(content::WebContents* tab); |
156 void SetMouseLockTab(content::WebContents* tab); | 150 void SetMouseLockTab(content::WebContents* tab); |
157 | 151 |
158 // Make the current tab exit fullscreen mode or mouse lock if it is in it. | 152 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
159 void ExitTabFullscreenOrMouseLockIfNecessary(); | 153 void ExitTabFullscreenOrMouseLockIfNecessary(); |
160 void UpdateFullscreenExitBubbleContent(); | 154 void UpdateFullscreenExitBubbleContent(); |
161 | 155 |
162 ContentSetting GetFullscreenSetting(const GURL& url) const; | 156 ContentSetting GetFullscreenSetting(const GURL& url) const; |
163 ContentSetting GetMouseLockSetting(const GURL& url) const; | 157 ContentSetting GetMouseLockSetting(const GURL& url) const; |
164 | 158 |
(...skipping 29 matching lines...) Expand all Loading... |
194 content::NotificationRegistrar registrar_; | 188 content::NotificationRegistrar registrar_; |
195 | 189 |
196 // Used to verify that calls we expect to reenter by calling | 190 // Used to verify that calls we expect to reenter by calling |
197 // WindowFullscreenStateChanged do so. | 191 // WindowFullscreenStateChanged do so. |
198 bool reentrant_window_state_change_call_check_; | 192 bool reentrant_window_state_change_call_check_; |
199 | 193 |
200 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 194 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
201 }; | 195 }; |
202 | 196 |
203 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ | 197 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_H_ |
OLD | NEW |