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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 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
« no previous file with comments | « base/command_line.cc ('k') | chrome/browser/browser_uitest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // SkBitmaps from the ResourceBundle. 565 // SkBitmaps from the ResourceBundle.
566 ResourceBundle::CleanupSharedInstance(); 566 ResourceBundle::CleanupSharedInstance();
567 } 567 }
568 568
569 if (!new_user_data_dir.empty()) { 569 if (!new_user_data_dir.empty()) {
570 // Because of the way CommandLine parses, it's sufficient to append a new 570 // Because of the way CommandLine parses, it's sufficient to append a new
571 // --user-data-dir switch. The last flag of the same name wins. 571 // --user-data-dir switch. The last flag of the same name wins.
572 // TODO(tc): It would be nice to remove the flag we don't want, but that 572 // TODO(tc): It would be nice to remove the flag we don't want, but that
573 // sounds risky if we parse differently than CommandLineToArgvW. 573 // sounds risky if we parse differently than CommandLineToArgvW.
574 CommandLine new_command_line = parameters.command_line_; 574 CommandLine new_command_line = parameters.command_line_;
575 new_command_line.AppendSwitchWithValue(switches::kUserDataDir, 575 new_command_line.AppendSwitchPath(switches::kUserDataDir,
576 new_user_data_dir.ToWStringHack()); 576 new_user_data_dir);
577 base::LaunchApp(new_command_line, false, false, NULL); 577 base::LaunchApp(new_command_line, false, false, NULL);
578 } 578 }
579 #else 579 #else
580 // TODO(port): fix this. See comments near the definition of 580 // TODO(port): fix this. See comments near the definition of
581 // user_data_dir. It is better to CHECK-fail here than it is to 581 // user_data_dir. It is better to CHECK-fail here than it is to
582 // silently exit because of missing code in the above test. 582 // silently exit because of missing code in the above test.
583 CHECK(profile) << "Cannot get default profile."; 583 CHECK(profile) << "Cannot get default profile.";
584 #endif 584 #endif
585 585
586 return NULL; 586 return NULL;
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 1265
1266 metrics->Stop(); 1266 metrics->Stop();
1267 1267
1268 // browser_shutdown takes care of deleting browser_process, so we need to 1268 // browser_shutdown takes care of deleting browser_process, so we need to
1269 // release it. 1269 // release it.
1270 ignore_result(browser_process.release()); 1270 ignore_result(browser_process.release());
1271 browser_shutdown::Shutdown(); 1271 browser_shutdown::Shutdown();
1272 1272
1273 return result_code; 1273 return result_code;
1274 } 1274 }
OLDNEW
« no previous file with comments | « base/command_line.cc ('k') | chrome/browser/browser_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698