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/fullscreen_controller.h" | 5 #include "chrome/browser/ui/fullscreen/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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "content/public/browser/navigation_details.h" | 21 #include "content/public/browser/navigation_details.h" |
22 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
23 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
25 #include "content/public/browser/render_widget_host_view.h" | 25 #include "content/public/browser/render_widget_host_view.h" |
26 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 | 28 |
29 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
30 #include "base/mac/mac_util.h" | 30 #include "base/mac/mac_util.h" |
31 #else | |
32 #include "base/prefs/pref_service.h" | |
33 #include "chrome/common/pref_names.h" | |
31 #endif | 34 #endif |
32 | 35 |
33 using content::RenderViewHost; | 36 using content::RenderViewHost; |
34 using content::UserMetricsAction; | 37 using content::UserMetricsAction; |
35 using content::WebContents; | 38 using content::WebContents; |
36 | 39 |
37 FullscreenController::FullscreenController(Browser* browser) | 40 FullscreenController::FullscreenController(Browser* browser) |
38 : ptr_factory_(this), | 41 : ptr_factory_(this), |
39 browser_(browser), | 42 browser_(browser), |
40 window_(browser->window()), | 43 window_(browser->window()), |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 else | 548 else |
546 enter_fullscreen |= window_->IsFullscreenWithChrome(); | 549 enter_fullscreen |= window_->IsFullscreenWithChrome(); |
547 } | 550 } |
548 #endif | 551 #endif |
549 | 552 |
550 // In kiosk mode, we always want to be fullscreen. When the browser first | 553 // In kiosk mode, we always want to be fullscreen. When the browser first |
551 // starts we're not yet fullscreen, so let the initial toggle go through. | 554 // starts we're not yet fullscreen, so let the initial toggle go through. |
552 if (chrome::IsRunningInAppMode() && window_->IsFullscreen()) | 555 if (chrome::IsRunningInAppMode() && window_->IsFullscreen()) |
553 return; | 556 return; |
554 | 557 |
558 #if !defined(OS_MACOSX) | |
559 // Do not enter fullscreen mode if disallowed by pref. | |
scheib
2013/08/22 23:57:26
Have you tested this in combination with kiosk mod
bartfab (slow)
2013/08/23 11:54:21
Added documentation here, in pref_names.cc and pol
| |
560 if (enter_fullscreen && | |
561 !profile_->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { | |
562 return; | |
563 } | |
564 #endif | |
565 | |
555 if (enter_fullscreen) | 566 if (enter_fullscreen) |
556 EnterFullscreenModeInternal(option); | 567 EnterFullscreenModeInternal(option); |
557 else | 568 else |
558 ExitFullscreenModeInternal(); | 569 ExitFullscreenModeInternal(); |
559 } | 570 } |
560 | 571 |
561 void FullscreenController::EnterFullscreenModeInternal( | 572 void FullscreenController::EnterFullscreenModeInternal( |
562 FullscreenInternalOption option) { | 573 FullscreenInternalOption option) { |
563 toggled_into_fullscreen_ = true; | 574 toggled_into_fullscreen_ = true; |
564 GURL url; | 575 GURL url; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 | 664 |
654 ContentSetting | 665 ContentSetting |
655 FullscreenController::GetMouseLockSetting(const GURL& url) const { | 666 FullscreenController::GetMouseLockSetting(const GURL& url) const { |
656 if (url.SchemeIsFile()) | 667 if (url.SchemeIsFile()) |
657 return CONTENT_SETTING_ALLOW; | 668 return CONTENT_SETTING_ALLOW; |
658 | 669 |
659 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); | 670 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); |
660 return settings_map->GetContentSetting(url, url, | 671 return settings_map->GetContentSetting(url, url, |
661 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); | 672 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); |
662 } | 673 } |
OLD | NEW |