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

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

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
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_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 if (param.value().size() > 2 && 1262 if (param.value().size() > 2 &&
1263 param.value()[0] == '?' && param.value()[1] == ' ') { 1263 param.value()[0] == '?' && param.value()[1] == ' ') {
1264 const TemplateURL* default_provider = 1264 const TemplateURL* default_provider =
1265 TemplateURLServiceFactory::GetForProfile(profile)-> 1265 TemplateURLServiceFactory::GetForProfile(profile)->
1266 GetDefaultSearchProvider(); 1266 GetDefaultSearchProvider();
1267 if (default_provider && default_provider->url()) { 1267 if (default_provider && default_provider->url()) {
1268 const TemplateURLRef* search_url = default_provider->url(); 1268 const TemplateURLRef* search_url = default_provider->url();
1269 DCHECK(search_url->SupportsReplacement()); 1269 DCHECK(search_url->SupportsReplacement());
1270 string16 search_term = param.LossyDisplayName().substr(2); 1270 string16 search_term = param.LossyDisplayName().substr(2);
1271 urls.push_back(GURL(search_url->ReplaceSearchTerms( 1271 urls.push_back(GURL(search_url->ReplaceSearchTerms(
1272 *default_provider, search_term, 1272 profile, *default_provider, search_term,
1273 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, 1273 TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
1274 string16()))); 1274 string16())));
1275 continue; 1275 continue;
1276 } 1276 }
1277 } 1277 }
1278 1278
1279 // Otherwise, fall through to treating it as a URL. 1279 // Otherwise, fall through to treating it as a URL.
1280 1280
1281 // This will create a file URL or a regular URL. 1281 // This will create a file URL or a regular URL.
1282 // This call can (in rare circumstances) block the UI thread. 1282 // This call can (in rare circumstances) block the UI thread.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 return false; 1449 return false;
1450 automation->SetExpectedTabCount(expected_tabs); 1450 automation->SetExpectedTabCount(expected_tabs);
1451 1451
1452 AutomationProviderList* list = 1452 AutomationProviderList* list =
1453 g_browser_process->InitAutomationProviderList(); 1453 g_browser_process->InitAutomationProviderList();
1454 DCHECK(list); 1454 DCHECK(list);
1455 list->AddProvider(automation); 1455 list->AddProvider(automation);
1456 1456
1457 return true; 1457 return true;
1458 } 1458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698