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

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

Issue 6526040: CommandLine refactoring and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits, merge changes. Created 9 years, 7 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 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 } 1197 }
1198 BrowserThread::PostTask( 1198 BrowserThread::PostTask(
1199 BrowserThread::FILE, FROM_HERE, new CheckDefaultBrowserTask()); 1199 BrowserThread::FILE, FROM_HERE, new CheckDefaultBrowserTask());
1200 } 1200 }
1201 1201
1202 std::vector<GURL> BrowserInit::GetURLsFromCommandLine( 1202 std::vector<GURL> BrowserInit::GetURLsFromCommandLine(
1203 const CommandLine& command_line, 1203 const CommandLine& command_line,
1204 const FilePath& cur_dir, 1204 const FilePath& cur_dir,
1205 Profile* profile) { 1205 Profile* profile) {
1206 std::vector<GURL> urls; 1206 std::vector<GURL> urls;
1207 const std::vector<CommandLine::StringType>& params = command_line.args(); 1207 CommandLine::StringVector params = command_line.args();
1208 1208
1209 for (size_t i = 0; i < params.size(); ++i) { 1209 for (size_t i = 0; i < params.size(); ++i) {
1210 FilePath param = FilePath(params[i]); 1210 FilePath param = FilePath(params[i]);
1211 // Handle Vista way of searching - "? <search-term>" 1211 // Handle Vista way of searching - "? <search-term>"
1212 if (param.value().size() > 2 && 1212 if (param.value().size() > 2 &&
1213 param.value()[0] == '?' && param.value()[1] == ' ') { 1213 param.value()[0] == '?' && param.value()[1] == ' ') {
1214 const TemplateURL* default_provider = 1214 const TemplateURL* default_provider =
1215 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); 1215 profile->GetTemplateURLModel()->GetDefaultSearchProvider();
1216 if (default_provider && default_provider->url()) { 1216 if (default_provider && default_provider->url()) {
1217 const TemplateURLRef* search_url = default_provider->url(); 1217 const TemplateURLRef* search_url = default_provider->url();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 return false; 1397 return false;
1398 automation->SetExpectedTabCount(expected_tabs); 1398 automation->SetExpectedTabCount(expected_tabs);
1399 1399
1400 AutomationProviderList* list = 1400 AutomationProviderList* list =
1401 g_browser_process->InitAutomationProviderList(); 1401 g_browser_process->InitAutomationProviderList();
1402 DCHECK(list); 1402 DCHECK(list);
1403 list->AddProvider(automation); 1403 list->AddProvider(automation);
1404 1404
1405 return true; 1405 return true;
1406 } 1406 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | chrome/common/switch_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698