| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 // TODO(koz): Change |for_tab| to an enum. | 548 // TODO(koz): Change |for_tab| to an enum. |
| 549 void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) { | 549 void FullscreenController::ToggleFullscreenModeInternal(bool for_tab) { |
| 550 #if defined(OS_WIN) | 550 #if defined(OS_WIN) |
| 551 // When in Metro snap mode, toggling in and out of fullscreen is prevented. | 551 // When in Metro snap mode, toggling in and out of fullscreen is prevented. |
| 552 if (IsInMetroSnapMode()) | 552 if (IsInMetroSnapMode()) |
| 553 return; | 553 return; |
| 554 #endif | 554 #endif |
| 555 | 555 |
| 556 toggled_into_fullscreen_ = !window_->IsFullscreen(); | 556 toggled_into_fullscreen_ = !window_->IsFullscreen(); |
| 557 | 557 |
| 558 // In kiosk mode, we always want to be fullscreen. When the browser first | 558 // In kiosk mode, we always want to be fullscreen. When the browser first |
| 559 // starts we're not yet fullscreen, so let the initial toggle go through. | 559 // starts we're not yet fullscreen, so let the initial toggle go through. |
| 560 #if !defined(OS_MACOSX) // Kiosk mode not available on Mac. | |
| 561 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) && | 560 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) && |
| 562 window_->IsFullscreen()) | 561 !toggled_into_fullscreen_) |
| 563 return; | 562 return; |
| 564 #endif | |
| 565 | 563 |
| 566 GURL url; | 564 GURL url; |
| 567 if (for_tab) { | 565 if (for_tab) { |
| 568 url = browser_->GetActiveWebContents()->GetURL(); | 566 url = browser_->GetActiveWebContents()->GetURL(); |
| 569 tab_fullscreen_accepted_ = toggled_into_fullscreen_ && | 567 tab_fullscreen_accepted_ = toggled_into_fullscreen_ && |
| 570 GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW; | 568 GetFullscreenSetting(url) == CONTENT_SETTING_ALLOW; |
| 571 } else { | 569 } else { |
| 572 if (!extension_caused_fullscreen_.is_empty()) | 570 if (!extension_caused_fullscreen_.is_empty()) |
| 573 url = extension_caused_fullscreen_; | 571 url = extension_caused_fullscreen_; |
| 574 content::RecordAction(UserMetricsAction("ToggleFullscreen")); | 572 content::RecordAction(UserMetricsAction("ToggleFullscreen")); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 589 | 587 |
| 590 void FullscreenController::SetFullscreenedTab(TabContents* tab) { | 588 void FullscreenController::SetFullscreenedTab(TabContents* tab) { |
| 591 fullscreened_tab_ = tab; | 589 fullscreened_tab_ = tab; |
| 592 UpdateNotificationRegistrations(); | 590 UpdateNotificationRegistrations(); |
| 593 } | 591 } |
| 594 | 592 |
| 595 void FullscreenController::SetMouseLockTab(TabContents* tab) { | 593 void FullscreenController::SetMouseLockTab(TabContents* tab) { |
| 596 mouse_lock_tab_ = tab; | 594 mouse_lock_tab_ = tab; |
| 597 UpdateNotificationRegistrations(); | 595 UpdateNotificationRegistrations(); |
| 598 } | 596 } |
| OLD | NEW |