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

Side by Side Diff: chrome/browser/ui/fullscreen/fullscreen_controller.cc

Issue 18576005: [Mac] Adds a flag to force 10.6-style fullscreen for testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove broken DCHECK. Created 7 years, 5 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 unified diff | Download patch
OLDNEW
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.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/app_mode/app_mode_utils.h" 10 #include "chrome/browser/app_mode/app_mode_utils.h"
11 #include "chrome/browser/content_settings/host_content_settings_map.h" 11 #include "chrome/browser/content_settings/host_content_settings_map.h"
12 #include "chrome/browser/download/download_shelf.h" 12 #include "chrome/browser/download/download_shelf.h"
13 #include "chrome/browser/fullscreen.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_window.h" 16 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/common/chrome_notification_types.h" 18 #include "chrome/common/chrome_notification_types.h"
18 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/extensions/extension.h" 20 #include "chrome/common/extensions/extension.h"
20 #include "content/public/browser/navigation_details.h" 21 #include "content/public/browser/navigation_details.h"
21 #include "content/public/browser/navigation_entry.h" 22 #include "content/public/browser/navigation_entry.h"
22 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
23 #include "content/public/browser/render_view_host.h" 24 #include "content/public/browser/render_view_host.h"
24 #include "content/public/browser/render_widget_host_view.h" 25 #include "content/public/browser/render_widget_host_view.h"
25 #include "content/public/browser/user_metrics.h" 26 #include "content/public/browser/user_metrics.h"
26 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
27 28
28 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
29 #include "base/mac/mac_util.h" 30 #include "base/mac/mac_util.h"
scheib 2013/07/10 19:47:58 You can remove this include now.
30 #endif 31 #endif
31 32
32 using content::RenderViewHost; 33 using content::RenderViewHost;
33 using content::UserMetricsAction; 34 using content::UserMetricsAction;
34 using content::WebContents; 35 using content::WebContents;
35 36
36 FullscreenController::FullscreenController(Browser* browser) 37 FullscreenController::FullscreenController(Browser* browser)
37 : ptr_factory_(this), 38 : ptr_factory_(this),
38 browser_(browser), 39 browser_(browser),
39 window_(browser->window()), 40 window_(browser->window()),
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 url = extension_caused_fullscreen_; 565 url = extension_caused_fullscreen_;
565 } 566 }
566 567
567 if (option == BROWSER) 568 if (option == BROWSER)
568 content::RecordAction(UserMetricsAction("ToggleFullscreen")); 569 content::RecordAction(UserMetricsAction("ToggleFullscreen"));
569 // TODO(scheib): Record metrics for WITH_CHROME, without counting transitions 570 // TODO(scheib): Record metrics for WITH_CHROME, without counting transitions
570 // from tab fullscreen out to browser with chrome. 571 // from tab fullscreen out to browser with chrome.
571 572
572 #if defined(OS_MACOSX) 573 #if defined(OS_MACOSX)
573 if (option == BROWSER_WITH_CHROME) { 574 if (option == BROWSER_WITH_CHROME) {
574 CHECK(base::mac::IsOSLionOrLater()); 575 CHECK(chrome::mac::SupportsSystemFullscreen());
575 window_->EnterFullscreenWithChrome(); 576 window_->EnterFullscreenWithChrome();
576 } else { 577 } else {
577 #else 578 #else
578 { 579 {
579 #endif 580 #endif
580 window_->EnterFullscreen(url, GetFullscreenExitBubbleType()); 581 window_->EnterFullscreen(url, GetFullscreenExitBubbleType());
581 } 582 }
582 583
583 UpdateFullscreenExitBubbleContent(); 584 UpdateFullscreenExitBubbleContent();
584 585
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 647
647 ContentSetting 648 ContentSetting
648 FullscreenController::GetMouseLockSetting(const GURL& url) const { 649 FullscreenController::GetMouseLockSetting(const GURL& url) const {
649 if (url.SchemeIsFile()) 650 if (url.SchemeIsFile())
650 return CONTENT_SETTING_ALLOW; 651 return CONTENT_SETTING_ALLOW;
651 652
652 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap(); 653 HostContentSettingsMap* settings_map = profile_->GetHostContentSettingsMap();
653 return settings_map->GetContentSetting(url, url, 654 return settings_map->GetContentSetting(url, url,
654 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string()); 655 CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string());
655 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698