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

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

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS Created 5 years, 4 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/singleton_tabs.h" 5 #include "chrome/browser/ui/singleton_tabs.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/search/search.h" 8 #include "chrome/browser/search/search.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 void ShowSingletonTabOverwritingNTP(Browser* browser, 44 void ShowSingletonTabOverwritingNTP(Browser* browser,
45 const NavigateParams& params) { 45 const NavigateParams& params) {
46 DCHECK(browser); 46 DCHECK(browser);
47 NavigateParams local_params(params); 47 NavigateParams local_params(params);
48 content::WebContents* contents = 48 content::WebContents* contents =
49 browser->tab_strip_model()->GetActiveWebContents(); 49 browser->tab_strip_model()->GetActiveWebContents();
50 if (contents) { 50 if (contents) {
51 const GURL& contents_url = contents->GetURL(); 51 const GURL& contents_url = contents->GetURL();
52 if ((contents_url == GURL(kChromeUINewTabURL) || IsInstantNTP(contents) || 52 if ((contents_url == GURL(kChromeUINewTabURL) ||
53 search::IsInstantNTP(contents) ||
53 contents_url == GURL(url::kAboutBlankURL)) && 54 contents_url == GURL(url::kAboutBlankURL)) &&
54 GetIndexOfSingletonTab(&local_params) < 0) { 55 GetIndexOfSingletonTab(&local_params) < 0) {
55 local_params.disposition = CURRENT_TAB; 56 local_params.disposition = CURRENT_TAB;
56 } 57 }
57 } 58 }
58 59
59 Navigate(&local_params); 60 Navigate(&local_params);
60 } 61 }
61 62
62 NavigateParams GetSingletonTabNavigateParams(Browser* browser, 63 NavigateParams GetSingletonTabNavigateParams(Browser* browser,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 replacements)) { 123 replacements)) {
123 params->target_contents = tab; 124 params->target_contents = tab;
124 return tab_index; 125 return tab_index;
125 } 126 }
126 } 127 }
127 128
128 return -1; 129 return -1;
129 } 130 }
130 131
131 } // namespace chrome 132 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper_unittest.cc ('k') | chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698