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

Unified Diff: chrome/browser/ui/fullscreen_controller.cc

Issue 9702055: Automated tests for full screen & mouse lock M16 features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FileURL & BrowserTest compilation fixes Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/fullscreen_controller.cc
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index 4908a345f6eb34cdea0bbf563e6073a2066cd75e..dd25b65ff1bfb224ea91a079b3a22baa50bc3906 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -38,16 +38,12 @@ FullscreenController::FullscreenController(BrowserWindow* window,
FullscreenController::~FullscreenController() {}
-bool FullscreenController::IsFullscreenForTab() const {
- return fullscreened_tab_ != NULL;
+bool FullscreenController::IsFullscreenForBrowser() const {
+ return window_->IsFullscreen() && !tab_caused_fullscreen_;
}
-bool FullscreenController::IsFullscreenForTab(const WebContents* tab) const {
- if (IsFullscreenForTabOrPending(tab)) {
- DCHECK(window_->IsFullscreen());
- return true;
- }
- return false;
+bool FullscreenController::IsFullscreenForTabOrPending() const {
+ return fullscreened_tab_ != NULL;
}
bool FullscreenController::IsFullscreenForTabOrPending(
@@ -60,6 +56,10 @@ bool FullscreenController::IsFullscreenForTabOrPending(
return true;
}
+bool FullscreenController::IsMouseLockedOrPending() const {
+ return mouse_lock_state_ != MOUSELOCK_NOT_REQUESTED;
+}
+
void FullscreenController::RequestToLockMouse(WebContents* tab) {
// Mouse Lock is only permitted when browser is in tab fullscreen.
if (!IsFullscreenForTabOrPending(tab)) {
@@ -170,7 +170,7 @@ void FullscreenController::LostMouseLock() {
}
void FullscreenController::OnTabClosing(WebContents* web_contents) {
- if (IsFullscreenForTab(web_contents)) {
+ if (IsFullscreenForTabOrPending(web_contents)) {
ExitTabbedFullscreenModeIfNecessary();
// The call to exit fullscreen may result in asynchronous notification of
// fullscreen state change (e.g., on Linux). We don't want to rely on it
@@ -264,7 +264,7 @@ void FullscreenController::WindowFullscreenStateChanged() {
}
bool FullscreenController::HandleUserPressedEscape() {
- if (!IsFullscreenForTab())
+ if (!IsFullscreenForTabOrPending())
return false;
ExitTabbedFullscreenModeIfNecessary();
return true;

Powered by Google App Engine
This is Rietveld 408576698