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

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

Issue 1323733002: Set display mode for browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use window_->IsFullscreen() Created 5 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #include "chrome/browser/ui/browser_list.h" 100 #include "chrome/browser/ui/browser_list.h"
101 #include "chrome/browser/ui/browser_navigator.h" 101 #include "chrome/browser/ui/browser_navigator.h"
102 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" 102 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
103 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" 103 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h"
104 #include "chrome/browser/ui/browser_tabstrip.h" 104 #include "chrome/browser/ui/browser_tabstrip.h"
105 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" 105 #include "chrome/browser/ui/browser_toolbar_model_delegate.h"
106 #include "chrome/browser/ui/browser_ui_prefs.h" 106 #include "chrome/browser/ui/browser_ui_prefs.h"
107 #include "chrome/browser/ui/browser_window.h" 107 #include "chrome/browser/ui/browser_window.h"
108 #include "chrome/browser/ui/chrome_pages.h" 108 #include "chrome/browser/ui/chrome_pages.h"
109 #include "chrome/browser/ui/chrome_select_file_policy.h" 109 #include "chrome/browser/ui/chrome_select_file_policy.h"
110 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
sky 2015/09/04 14:58:36 You can remove this include now.
Mikhail 2015/09/07 09:54:42 Indeed! Thanks!
110 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 111 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
111 #include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h" 112 #include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h"
112 #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h" 113 #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h"
113 #include "chrome/browser/ui/fast_unload_controller.h" 114 #include "chrome/browser/ui/fast_unload_controller.h"
114 #include "chrome/browser/ui/find_bar/find_bar.h" 115 #include "chrome/browser/ui/find_bar/find_bar.h"
115 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 116 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
116 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 117 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
117 #include "chrome/browser/ui/global_error/global_error.h" 118 #include "chrome/browser/ui/global_error/global_error.h"
118 #include "chrome/browser/ui/global_error/global_error_service.h" 119 #include "chrome/browser/ui/global_error/global_error_service.h"
119 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 120 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 exclusive_access_manager_->fullscreen_controller()->ExitFullscreenModeForTab( 1728 exclusive_access_manager_->fullscreen_controller()->ExitFullscreenModeForTab(
1728 web_contents); 1729 web_contents);
1729 } 1730 }
1730 1731
1731 bool Browser::IsFullscreenForTabOrPending( 1732 bool Browser::IsFullscreenForTabOrPending(
1732 const WebContents* web_contents) const { 1733 const WebContents* web_contents) const {
1733 return exclusive_access_manager_->fullscreen_controller() 1734 return exclusive_access_manager_->fullscreen_controller()
1734 ->IsFullscreenForTabOrPending(web_contents); 1735 ->IsFullscreenForTabOrPending(web_contents);
1735 } 1736 }
1736 1737
1738 blink::WebDisplayMode Browser::GetDisplayMode(
1739 const WebContents* web_contents) const {
1740 if (window_->IsFullscreen())
1741 return blink::WebDisplayModeFullscreen;
1742
1743 if (is_type_popup())
1744 return blink::WebDisplayModeStandalone;
1745
1746 return blink::WebDisplayModeBrowser;
1747 }
1748
1737 void Browser::RegisterProtocolHandler(WebContents* web_contents, 1749 void Browser::RegisterProtocolHandler(WebContents* web_contents,
1738 const std::string& protocol, 1750 const std::string& protocol,
1739 const GURL& url, 1751 const GURL& url,
1740 bool user_gesture) { 1752 bool user_gesture) {
1741 content::BrowserContext* context = web_contents->GetBrowserContext(); 1753 content::BrowserContext* context = web_contents->GetBrowserContext();
1742 if (context->IsOffTheRecord()) 1754 if (context->IsOffTheRecord())
1743 return; 1755 return;
1744 1756
1745 ProtocolHandler handler = 1757 ProtocolHandler handler =
1746 ProtocolHandler::CreateProtocolHandler(protocol, url); 1758 ProtocolHandler::CreateProtocolHandler(protocol, url);
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 if (contents && !allow_js_access) { 2651 if (contents && !allow_js_access) {
2640 contents->web_contents()->GetController().LoadURL( 2652 contents->web_contents()->GetController().LoadURL(
2641 target_url, 2653 target_url,
2642 content::Referrer(), 2654 content::Referrer(),
2643 ui::PAGE_TRANSITION_LINK, 2655 ui::PAGE_TRANSITION_LINK,
2644 std::string()); // No extra headers. 2656 std::string()); // No extra headers.
2645 } 2657 }
2646 2658
2647 return contents != NULL; 2659 return contents != NULL;
2648 } 2660 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698