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

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: Valgrind error fix, merge to 130358 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
« no previous file with comments | « chrome/browser/ui/fullscreen_controller.h ('k') | chrome/browser/ui/tests/browser_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/fullscreen_controller.cc
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index 36ebb44258d6de755c2f26612c9c6892ca76d268..24f363a476d1efec23817b2ce2aaf4a0c5af496a 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -39,16 +39,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(
@@ -61,6 +57,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)) {
@@ -171,7 +171,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
@@ -265,7 +265,7 @@ void FullscreenController::WindowFullscreenStateChanged() {
}
bool FullscreenController::HandleUserPressedEscape() {
- if (!IsFullscreenForTab())
+ if (!IsFullscreenForTabOrPending())
return false;
ExitTabbedFullscreenModeIfNecessary();
return true;
« no previous file with comments | « chrome/browser/ui/fullscreen_controller.h ('k') | chrome/browser/ui/tests/browser_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698