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

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

Issue 1336823003: Move chrome::HostDesktopType to ui::HostDesktopType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@base_session_service_delegate_impl
Patch Set: Fix build on Mac and CrOS 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
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/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // multiple tabs, such as app frames and popups. This function returns false for 72 // multiple tabs, such as app frames and popups. This function returns false for
73 // those types of Browser. 73 // those types of Browser.
74 bool WindowCanOpenTabs(Browser* browser) { 74 bool WindowCanOpenTabs(Browser* browser) {
75 return browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP) || 75 return browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP) ||
76 browser->tab_strip_model()->empty(); 76 browser->tab_strip_model()->empty();
77 } 77 }
78 78
79 // Finds an existing Browser compatible with |profile|, making a new one if no 79 // Finds an existing Browser compatible with |profile|, making a new one if no
80 // such Browser is located. 80 // such Browser is located.
81 Browser* GetOrCreateBrowser(Profile* profile, 81 Browser* GetOrCreateBrowser(Profile* profile,
82 chrome::HostDesktopType host_desktop_type) { 82 ui::HostDesktopType host_desktop_type) {
83 Browser* browser = chrome::FindTabbedBrowser(profile, false, 83 Browser* browser = chrome::FindTabbedBrowser(profile, false,
84 host_desktop_type); 84 host_desktop_type);
85 return browser ? browser : new Browser( 85 return browser ? browser : new Browser(
86 Browser::CreateParams(profile, host_desktop_type)); 86 Browser::CreateParams(profile, host_desktop_type));
87 } 87 }
88 88
89 // Change some of the navigation parameters based on the particular URL. 89 // Change some of the navigation parameters based on the particular URL.
90 // Currently this applies to some chrome:// pages which we always want to open 90 // Currently this applies to some chrome:// pages which we always want to open
91 // in a non-incognito window. Note that even though a ChromeOS guest session is 91 // in a non-incognito window. Note that even though a ChromeOS guest session is
92 // technically an incognito window, these URLs are allowed. 92 // technically an incognito window, these URLs are allowed.
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 InstantSearchPrerenderer::GetForProfile(profile); 392 InstantSearchPrerenderer::GetForProfile(profile);
393 if (prerenderer && prerenderer->UsePrerenderedPage(url, params)) 393 if (prerenderer && prerenderer->UsePrerenderedPage(url, params))
394 return true; 394 return true;
395 395
396 prerender::PrerenderManager* prerender_manager = 396 prerender::PrerenderManager* prerender_manager =
397 prerender::PrerenderManagerFactory::GetForProfile(profile); 397 prerender::PrerenderManagerFactory::GetForProfile(profile);
398 return prerender_manager && 398 return prerender_manager &&
399 prerender_manager->MaybeUsePrerenderedPage(url, params); 399 prerender_manager->MaybeUsePrerenderedPage(url, params);
400 } 400 }
401 401
402 chrome::HostDesktopType GetHostDesktop(Browser* browser) { 402 ui::HostDesktopType GetHostDesktop(Browser* browser) {
403 if (browser) 403 if (browser)
404 return browser->host_desktop_type(); 404 return browser->host_desktop_type();
405 return chrome::GetActiveDesktop(); 405 return chrome::GetActiveDesktop();
406 } 406 }
407 407
408 } // namespace 408 } // namespace
409 409
410 namespace chrome { 410 namespace chrome {
411 411
412 NavigateParams::NavigateParams(Browser* a_browser, 412 NavigateParams::NavigateParams(Browser* a_browser,
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 bool reverse_on_redirect = false; 756 bool reverse_on_redirect = false;
757 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 757 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
758 &rewritten_url, browser_context, &reverse_on_redirect); 758 &rewritten_url, browser_context, &reverse_on_redirect);
759 759
760 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 760 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
761 return !(rewritten_url.scheme() == content::kChromeUIScheme && 761 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
762 rewritten_url.host() == chrome::kChromeUIUberHost); 762 rewritten_url.host() == chrome::kChromeUIUberHost);
763 } 763 }
764 764
765 } // namespace chrome 765 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698