summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 23:02:34 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 23:02:34 +0000
commit4f08c83f354cb0c9d2ee5c79c39c1ad08e560cdf (patch)
tree41963c12afc6c484be43d69d1c31c242ed5b7488 /chrome_frame
parentd7ab056d66464c89ba336c4b466a8ad45f2afb6e (diff)
downloadchromium_src-4f08c83f354cb0c9d2ee5c79c39c1ad08e560cdf.zip
chromium_src-4f08c83f354cb0c9d2ee5c79c39c1ad08e560cdf.tar.gz
chromium_src-4f08c83f354cb0c9d2ee5c79c39c1ad08e560cdf.tar.bz2
CommandLine: add a CopySwitchesFrom() and AppendSwitchPath()
These are two common patterns in Chrome code: copying a subset of switches from one CommandLine to another, and appending a FilePath to a CommandLine. This sets me up to do a lot more deprecation in a follow-up change. Review URL: http://codereview.chromium.org/3012021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_automation.cc5
-rw-r--r--chrome_frame/chrome_launcher_unittest.cc2
-rw-r--r--chrome_frame/chrome_tab.cc2
3 files changed, 4 insertions, 5 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 8909923..bed7be2 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -280,7 +280,7 @@ void ProxyFactory::CreateProxy(ProxyFactory::ProxyCacheEntry* entry,
scoped_ptr<CommandLine> command_line(
chrome_launcher::CreateLaunchCommandLine());
command_line->AppendSwitchWithValue(switches::kAutomationClientChannelID,
- ASCIIToWide(proxy->channel_id()));
+ proxy->channel_id());
// Run Chrome in Chrome Frame mode. In practice, this modifies the paths
// and registry keys that Chrome looks in via the BrowserDistribution
@@ -304,8 +304,7 @@ void ProxyFactory::CreateProxy(ProxyFactory::ProxyCacheEntry* entry,
command_line->AppendSwitch(switches::kFullMemoryCrashReport);
DLOG(INFO) << "Profile path: " << params.profile_path.value();
- command_line->AppendSwitchWithValue(switches::kUserDataDir,
- params.profile_path.value());
+ command_line->AppendSwitchPath(switches::kUserDataDir, params.profile_path);
std::wstring command_line_string(command_line->command_line_string());
// If there are any extra arguments, append them to the command line.
diff --git a/chrome_frame/chrome_launcher_unittest.cc b/chrome_frame/chrome_launcher_unittest.cc
index 835fc35..9511b40 100644
--- a/chrome_frame/chrome_launcher_unittest.cc
+++ b/chrome_frame/chrome_launcher_unittest.cc
@@ -20,7 +20,7 @@ TEST(ChromeLauncher, IsValidCommandLine) {
CommandLine good(FilePath(L"dummy.exe"));
good.AppendSwitch(switches::kNoFirstRun); // in whitelist
- good.AppendSwitchWithValue(switches::kUserDataDir, L"foo"); // in whitelist
+ good.AppendSwitchWithValue(switches::kUserDataDir, "foo"); // in whitelist
EXPECT_TRUE(chrome_launcher::IsValidCommandLine(
good.command_line_string().c_str()));
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 920adfd..f7ff496 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -281,7 +281,7 @@ HRESULT SetupRunOnce() {
if (run_once.Create(HKEY_CURRENT_USER, kRunOnce, KEY_READ | KEY_WRITE)) {
CommandLine run_once_command(chrome_launcher::GetChromeExecutablePath());
run_once_command.AppendSwitchWithValue(
- switches::kAutomationClientChannelID, L"0");
+ switches::kAutomationClientChannelID, "0");
run_once_command.AppendSwitch(switches::kChromeFrame);
run_once.WriteValue(L"A", run_once_command.command_line_string().c_str());
}