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

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

Issue 1661713002: Remove the rest of HostDesktopType from c/b/ui/browser_finder.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-11
Patch Set: linux adl Created 4 years, 10 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/macros.h" 10 #include "base/macros.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // those types of Browser. 77 // those types of Browser.
78 bool WindowCanOpenTabs(Browser* browser) { 78 bool WindowCanOpenTabs(Browser* browser) {
79 return browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP) || 79 return browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP) ||
80 browser->tab_strip_model()->empty(); 80 browser->tab_strip_model()->empty();
81 } 81 }
82 82
83 // Finds an existing Browser compatible with |profile|, making a new one if no 83 // Finds an existing Browser compatible with |profile|, making a new one if no
84 // such Browser is located. 84 // such Browser is located.
85 Browser* GetOrCreateBrowser(Profile* profile, 85 Browser* GetOrCreateBrowser(Profile* profile,
86 chrome::HostDesktopType host_desktop_type) { 86 chrome::HostDesktopType host_desktop_type) {
87 Browser* browser = chrome::FindTabbedBrowser(profile, false, 87 Browser* browser = chrome::FindTabbedBrowser(profile, false);
88 host_desktop_type);
89 return browser ? browser : new Browser( 88 return browser ? browser : new Browser(
90 Browser::CreateParams(profile, host_desktop_type)); 89 Browser::CreateParams(profile, host_desktop_type));
91 } 90 }
92 91
93 // Change some of the navigation parameters based on the particular URL. 92 // Change some of the navigation parameters based on the particular URL.
94 // Currently this applies to some chrome:// pages which we always want to open 93 // Currently this applies to some chrome:// pages which we always want to open
95 // in a non-incognito window. Note that even though a ChromeOS guest session is 94 // in a non-incognito window. Note that even though a ChromeOS guest session is
96 // technically an incognito window, these URLs are allowed. 95 // technically an incognito window, these URLs are allowed.
97 // Returns true on success. Otherwise, if changing params leads the browser into 96 // Returns true on success. Otherwise, if changing params leads the browser into
98 // an erroneous state, returns false. 97 // an erroneous state, returns false.
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 bool reverse_on_redirect = false; 654 bool reverse_on_redirect = false;
656 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 655 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
657 &rewritten_url, browser_context, &reverse_on_redirect); 656 &rewritten_url, browser_context, &reverse_on_redirect);
658 657
659 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 658 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
660 return !(rewritten_url.scheme() == content::kChromeUIScheme && 659 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
661 rewritten_url.host() == chrome::kChromeUIUberHost); 660 rewritten_url.host() == chrome::kChromeUIUberHost);
662 } 661 }
663 662
664 } // namespace chrome 663 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_finder_chromeos_unittest.cc ('k') | chrome/browser/ui/chrome_pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698