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

Side by Side Diff: base/command_line.cc

Issue 16141008: Do not show sync promo when RestoreOnStartupURLs policy is set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit addressed. TODO added. Created 7 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc » ('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) 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 "base/command_line.h" 5 #include "base/command_line.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 void CommandLine::InitFromArgv(int argc, 213 void CommandLine::InitFromArgv(int argc,
214 const CommandLine::CharType* const* argv) { 214 const CommandLine::CharType* const* argv) {
215 StringVector new_argv; 215 StringVector new_argv;
216 for (int i = 0; i < argc; ++i) 216 for (int i = 0; i < argc; ++i)
217 new_argv.push_back(argv[i]); 217 new_argv.push_back(argv[i]);
218 InitFromArgv(new_argv); 218 InitFromArgv(new_argv);
219 } 219 }
220 220
221 void CommandLine::InitFromArgv(const StringVector& argv) { 221 void CommandLine::InitFromArgv(const StringVector& argv) {
222 argv_ = StringVector(1); 222 argv_ = StringVector(1);
223 switches_.clear();
223 begin_args_ = 1; 224 begin_args_ = 1;
224 SetProgram(argv.empty() ? FilePath() : FilePath(argv[0])); 225 SetProgram(argv.empty() ? FilePath() : FilePath(argv[0]));
225 AppendSwitchesAndArguments(*this, argv); 226 AppendSwitchesAndArguments(*this, argv);
226 } 227 }
227 228
228 CommandLine::StringType CommandLine::GetCommandLineString() const { 229 CommandLine::StringType CommandLine::GetCommandLineString() const {
229 StringType string(argv_[0]); 230 StringType string(argv_[0]);
230 #if defined(OS_WIN) 231 #if defined(OS_WIN)
231 string = QuoteForCommandLineToArgvW(string); 232 string = QuoteForCommandLineToArgvW(string);
232 #endif 233 #endif
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 int num_args = 0; 410 int num_args = 0;
410 wchar_t** args = NULL; 411 wchar_t** args = NULL;
411 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args); 412 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args);
412 413
413 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " 414 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: "
414 << command_line; 415 << command_line;
415 InitFromArgv(num_args, args); 416 InitFromArgv(num_args, args);
416 LocalFree(args); 417 LocalFree(args);
417 } 418 }
418 #endif 419 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698