Chromium Code Reviews| 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 #include "chrome/browser/ui/fullscreen_controller.h" | 5 #include "chrome/browser/ui/fullscreen_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 if (!wrapper || (wrapper != fullscreened_tab_)) | 52 if (!wrapper || (wrapper != fullscreened_tab_)) |
| 53 return false; | 53 return false; |
| 54 DCHECK(tab == browser_->GetSelectedWebContents()); | 54 DCHECK(tab == browser_->GetSelectedWebContents()); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool FullscreenController::IsMouseLockedOrPending() const { | 58 bool FullscreenController::IsMouseLockedOrPending() const { |
| 59 return mouse_lock_state_ != MOUSELOCK_NOT_REQUESTED; | 59 return mouse_lock_state_ != MOUSELOCK_NOT_REQUESTED; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void FullscreenController::RequestToLockMouse(WebContents* tab) { | 62 void FullscreenController::RequestToLockMouse(WebContents* tab, |
| 63 bool /* user_gesture */) { | |
|
yzshen1
2012/04/25 23:24:36
One space after bool, please.
| |
| 64 // TODO(scheib) user_gesture required for Mouse Lock in Windowed Mode. | |
| 65 // See http://crbug.com/107013, which will land in multiple patches. | |
| 66 | |
| 63 // Mouse Lock is only permitted when browser is in tab fullscreen. | 67 // Mouse Lock is only permitted when browser is in tab fullscreen. |
| 64 if (!IsFullscreenForTabOrPending(tab)) { | 68 if (!IsFullscreenForTabOrPending(tab)) { |
| 65 tab->GotResponseToLockMouseRequest(false); | 69 tab->GotResponseToLockMouseRequest(false); |
| 66 return; | 70 return; |
| 67 } | 71 } |
| 68 | 72 |
| 69 if (mouse_lock_state_ == MOUSELOCK_ACCEPTED) { | 73 if (mouse_lock_state_ == MOUSELOCK_ACCEPTED) { |
| 70 tab->GotResponseToLockMouseRequest(true); | 74 tab->GotResponseToLockMouseRequest(true); |
| 71 return; | 75 return; |
| 72 } | 76 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 // WindowFullscreenStateChanged(). We don't do this immediately as | 407 // WindowFullscreenStateChanged(). We don't do this immediately as |
| 404 // BrowserWindow::EnterFullscreen() asks for bookmark_bar_state_, so we let | 408 // BrowserWindow::EnterFullscreen() asks for bookmark_bar_state_, so we let |
| 405 // the BrowserWindow invoke WindowFullscreenStateChanged when appropriate. | 409 // the BrowserWindow invoke WindowFullscreenStateChanged when appropriate. |
| 406 | 410 |
| 407 // TODO: convert mac to invoke WindowFullscreenStateChanged once it updates | 411 // TODO: convert mac to invoke WindowFullscreenStateChanged once it updates |
| 408 // the necessary state of the frame. | 412 // the necessary state of the frame. |
| 409 #if defined(OS_MACOSX) | 413 #if defined(OS_MACOSX) |
| 410 WindowFullscreenStateChanged(); | 414 WindowFullscreenStateChanged(); |
| 411 #endif | 415 #endif |
| 412 } | 416 } |
| OLD | NEW |