Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: chrome/browser/ui/fullscreen_controller.h

Issue 10559071: Exit mouse lock or fullscreen on navigation and reload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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();
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 set_fullscreened_tab(TabContents* tab);
yzshen1 2012/06/20 18:07:54 - nit: please use SetFullscreenedTab. - optional:
scheib 2012/06/20 20:38:24 Done.
139 void set_mouse_lock_tab(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.
148 TabContents* fullscreened_tab_; 147 TabContents* fullscreened_tab_;
149 148
150 // The URL of the extension which trigerred "browser fullscreen" mode. 149 // The URL of the extension which trigerred "browser fullscreen" mode.
151 GURL extension_caused_fullscreen_; 150 GURL extension_caused_fullscreen_;
152 151
153 // True if the current tab entered fullscreen mode via webkitRequestFullScreen 152 // True if the current tab entered fullscreen mode via webkitRequestFullScreen
154 bool tab_caused_fullscreen_; 153 bool tab_caused_fullscreen_;
155 // True if tab fullscreen has been allowed, either by settings or by user 154 // True if tab fullscreen has been allowed, either by settings or by user
156 // clicking the allow button on the fullscreen infobar. 155 // clicking the allow button on the fullscreen infobar.
157 bool tab_fullscreen_accepted_; 156 bool tab_fullscreen_accepted_;
158 157
159 // True if this controller has toggled into tab OR browser fullscreen. 158 // True if this controller has toggled into tab OR browser fullscreen.
160 bool toggled_into_fullscreen_; 159 bool toggled_into_fullscreen_;
161 160
162 // TabContents for current tab requesting or currently in mouse lock. 161 // TabContents for current tab requesting or currently in mouse lock.
163 TabContents* mouse_lock_tab_; 162 TabContents* mouse_lock_tab_;
164 163
165 MouseLockState mouse_lock_state_; 164 MouseLockState mouse_lock_state_;
166 165
167 content::NotificationRegistrar registrar_; 166 content::NotificationRegistrar registrar_;
168 167
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); 168 DISALLOW_COPY_AND_ASSIGN(FullscreenController);
174 }; 169 };
175 170
176 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_ 171 #endif // CHROME_BROWSER_UI_FULLSCREEN_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/fullscreen_controller.cc » ('j') | chrome/browser/ui/fullscreen_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698