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

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

Issue 8343052: Sync Promo: Tweak first tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: diff against correct branch Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_init.cc ('k') | chrome/test/base/testing_profile.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 std::string extra_headers; 439 std::string extra_headers;
440 440
441 // Check if this is a singleton tab that already exists 441 // Check if this is a singleton tab that already exists
442 int singleton_index = GetIndexOfSingletonTab(params); 442 int singleton_index = GetIndexOfSingletonTab(params);
443 443
444 // If no target TabContents was specified, we need to construct one if we are 444 // If no target TabContents was specified, we need to construct one if we are
445 // supposed to target a new tab; unless it's a singleton that already exists. 445 // supposed to target a new tab; unless it's a singleton that already exists.
446 if (!params->target_contents && singleton_index < 0) { 446 if (!params->target_contents && singleton_index < 0) {
447 GURL url; 447 GURL url;
448 if (params->url.is_empty()) { 448 if (params->url.is_empty()) {
449 url = params->browser->GetHomePage(); 449 url = params->browser->profile()->GetHomePage();
450 params->transition = content::PageTransitionFromInt( 450 params->transition = content::PageTransitionFromInt(
451 params->transition | content::PAGE_TRANSITION_HOME_PAGE); 451 params->transition | content::PAGE_TRANSITION_HOME_PAGE);
452 } else { 452 } else {
453 url = params->url; 453 url = params->url;
454 } 454 }
455 455
456 if (params->disposition != CURRENT_TAB) { 456 if (params->disposition != CURRENT_TAB) {
457 TabContents* source_contents = params->source_contents ? 457 TabContents* source_contents = params->source_contents ?
458 params->source_contents->tab_contents() : NULL; 458 params->source_contents->tab_contents() : NULL;
459 params->target_contents = 459 params->target_contents =
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 } 619 }
620 620
621 bool IsURLAllowedInIncognito(const GURL& url) { 621 bool IsURLAllowedInIncognito(const GURL& url) {
622 return url.scheme() == chrome::kChromeUIScheme && 622 return url.scheme() == chrome::kChromeUIScheme &&
623 (url.host() == chrome::kChromeUISettingsHost || 623 (url.host() == chrome::kChromeUISettingsHost ||
624 url.host() == chrome::kChromeUIExtensionsHost || 624 url.host() == chrome::kChromeUIExtensionsHost ||
625 url.host() == chrome::kChromeUIBookmarksHost); 625 url.host() == chrome::kChromeUIBookmarksHost);
626 } 626 }
627 627
628 } // namespace browser 628 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_init.cc ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698