| OLD | NEW |
| 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/common/chrome_plugin_util.h" | 5 #include "chrome/common/chrome_plugin_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if (!user_data_dir.empty()) { | 134 if (!user_data_dir.empty()) { |
| 135 // Make sure user_data_dir is an absolute path. | 135 // Make sure user_data_dir is an absolute path. |
| 136 if (file_util::AbsolutePath(&user_data_dir) && | 136 if (file_util::AbsolutePath(&user_data_dir) && |
| 137 file_util::PathExists(user_data_dir)) { | 137 file_util::PathExists(user_data_dir)) { |
| 138 // TODO(evanm): use CommandLine APIs instead of this. | 138 // TODO(evanm): use CommandLine APIs instead of this. |
| 139 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + | 139 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + |
| 140 L"=\"" + user_data_dir.ToWStringHack() + L"\" "; | 140 L"=\"" + user_data_dir.ToWStringHack() + L"\" "; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 #if defined (OS_CHROMEOS) | 144 #if defined(OS_CHROMEOS) |
| 145 std::wstring profile = cmd.GetSwitchValue(switches::kLoginProfile); | 145 FilePath profile = cmd.GetSwitchValuePath(switches::kLoginProfile); |
| 146 if (!profile.empty()) { | 146 if (!profile.empty()) { |
| 147 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) + | 147 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) + |
| 148 L"=\"" + profile + L"\" "; | 148 L"=\"" + profile.ToWStringHack() + L"\" "; |
| 149 } | 149 } |
| 150 #endif | 150 #endif |
| 151 | 151 |
| 152 // Use '--app=url' instead of just 'url' to launch the browser with minimal | 152 // Use '--app=url' instead of just 'url' to launch the browser with minimal |
| 153 // chrome. | 153 // chrome. |
| 154 // Note: Do not change this flag! Old Gears shortcuts will break if you do! | 154 // Note: Do not change this flag! Old Gears shortcuts will break if you do! |
| 155 std::string url_string(url); | 155 std::string url_string(url); |
| 156 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C"); | 156 ReplaceSubstringsAfterOffset(&url_string, 0, "\\", "%5C"); |
| 157 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22"); | 157 ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "%22"); |
| 158 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B"); | 158 ReplaceSubstringsAfterOffset(&url_string, 0, ";", "%3B"); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 174 // Host functions shared by browser and plugin processes | 174 // Host functions shared by browser and plugin processes |
| 175 // | 175 // |
| 176 | 176 |
| 177 void* STDCALL CPB_Alloc(uint32 size) { | 177 void* STDCALL CPB_Alloc(uint32 size) { |
| 178 return malloc(size); | 178 return malloc(size); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void STDCALL CPB_Free(void* memory) { | 181 void STDCALL CPB_Free(void* memory) { |
| 182 free(memory); | 182 free(memory); |
| 183 } | 183 } |
| OLD | NEW |