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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 // Mouse lock has been silently accepted, no notification to user. | 112 // Mouse lock has been silently accepted, no notification to user. |
113 MOUSELOCK_ACCEPTED_SILENTLY | 113 MOUSELOCK_ACCEPTED_SILENTLY |
114 }; | 114 }; |
115 | 115 |
116 virtual ~FullscreenController(); | 116 virtual ~FullscreenController(); |
117 | 117 |
118 // Notifies the tab that it has been forced out of fullscreen and mouse lock | 118 // Notifies the tab that it has been forced out of fullscreen and mouse lock |
119 // mode if necessary. | 119 // mode if necessary. |
120 void NotifyTabOfExitIfNecessary(); | 120 void NotifyTabOfExitIfNecessary(); |
121 | 121 |
122 // Makes the browser exit fullscreen mode when a navigation occurs. | 122 void UpdateNotificationRegistrations(); |
sky
2012/06/21 18:07:22
Add a description.
| |
123 void EnterCancelFullscreenOnNavigateMode(); | |
124 | |
125 // Makes the browser no longer exit fullscreen mode when a navigation occurs. | |
126 void ExitCancelFullscreenOnNavigateMode(); | |
127 | 123 |
128 // Make the current tab exit fullscreen mode or mouse lock if it is in it. | 124 // Make the current tab exit fullscreen mode or mouse lock if it is in it. |
129 void ExitTabFullscreenOrMouseLockIfNecessary(); | 125 void ExitTabFullscreenOrMouseLockIfNecessary(); |
130 void UpdateFullscreenExitBubbleContent(); | 126 void UpdateFullscreenExitBubbleContent(); |
131 void NotifyFullscreenChange(bool is_fullscreen); | 127 void NotifyFullscreenChange(bool is_fullscreen); |
132 void NotifyMouseLockChange(); | 128 void NotifyMouseLockChange(); |
133 ContentSetting GetFullscreenSetting(const GURL& url) const; | 129 ContentSetting GetFullscreenSetting(const GURL& url) const; |
134 ContentSetting GetMouseLockSetting(const GURL& url) const; | 130 ContentSetting GetMouseLockSetting(const GURL& url) const; |
135 | 131 |
136 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
137 void TogglePresentationModeInternal(bool for_tab); | 133 void TogglePresentationModeInternal(bool for_tab); |
138 #endif | 134 #endif |
139 // TODO(koz): Change |for_tab| to an enum. | 135 // TODO(koz): Change |for_tab| to an enum. |
140 void ToggleFullscreenModeInternal(bool for_tab); | 136 void ToggleFullscreenModeInternal(bool for_tab); |
141 | 137 |
138 void SetFullscreenedTab(TabContents* tab); | |
139 void SetMouseLockTab(TabContents* tab); | |
140 | |
142 BrowserWindow* window_; | 141 BrowserWindow* window_; |
143 Profile* profile_; | 142 Profile* profile_; |
144 Browser* browser_; | 143 Browser* browser_; |
145 | 144 |
146 // If there is currently a tab in fullscreen mode (entered via | 145 // If there is currently a tab in fullscreen mode (entered via |
147 // webkitRequestFullScreen), this is its TabContents. | 146 // webkitRequestFullScreen), this is its TabContents. |
147 // Assign using SetFullscreenedTab(). | |
148 TabContents* fullscreened_tab_; | 148 TabContents* fullscreened_tab_; |
149 | 149 |
150 // The URL of the extension which trigerred "browser fullscreen" mode. | 150 // The URL of the extension which trigerred "browser fullscreen" mode. |
151 GURL extension_caused_fullscreen_; | 151 GURL extension_caused_fullscreen_; |
152 | 152 |
153 // True if the current tab entered fullscreen mode via webkitRequestFullScreen | 153 // True if the current tab entered fullscreen mode via webkitRequestFullScreen |
154 bool tab_caused_fullscreen_; | 154 bool tab_caused_fullscreen_; |
155 // True if tab fullscreen has been allowed, either by settings or by user | 155 // True if tab fullscreen has been allowed, either by settings or by user |
156 // clicking the allow button on the fullscreen infobar. | 156 // clicking the allow button on the fullscreen infobar. |
157 bool tab_fullscreen_accepted_; | 157 bool tab_fullscreen_accepted_; |
158 | 158 |
159 // True if this controller has toggled into tab OR browser fullscreen. | 159 // True if this controller has toggled into tab OR browser fullscreen. |
160 bool toggled_into_fullscreen_; | 160 bool toggled_into_fullscreen_; |
161 | 161 |
162 // TabContents for current tab requesting or currently in mouse lock. | 162 // TabContents for current tab requesting or currently in mouse lock. |
163 // Assign using SetMouseLockTab(). | |
163 TabContents* mouse_lock_tab_; | 164 TabContents* mouse_lock_tab_; |
164 | 165 |
165 MouseLockState mouse_lock_state_; | 166 MouseLockState mouse_lock_state_; |
166 | 167 |
167 content::NotificationRegistrar registrar_; | 168 content::NotificationRegistrar registrar_; |
168 | 169 |
169 // If this is true then we are listening for navigation events and will | |
170 // cancel fullscreen when one occurs. | |
171 bool cancel_fullscreen_on_navigate_mode_; | |
172 | |
173 DISALLOW_COPY_AND_ASSIGN(FullscreenController); | 170 DISALLOW_COPY_AND_ASSIGN(FullscreenController); |
174 }; | 171 }; |
175 | 172 |
176 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ | 173 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ |
OLD | NEW |