OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 CPError CPB_GetCommandLineArgumentsCommon(const char* url, | 124 CPError CPB_GetCommandLineArgumentsCommon(const char* url, |
125 std::string* arguments) { | 125 std::string* arguments) { |
126 const CommandLine cmd = *CommandLine::ForCurrentProcess(); | 126 const CommandLine cmd = *CommandLine::ForCurrentProcess(); |
127 std::wstring arguments_w; | 127 std::wstring arguments_w; |
128 | 128 |
129 // Use the same UserDataDir for new launches that we currently have set. | 129 // Use the same UserDataDir for new launches that we currently have set. |
130 std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir); | 130 std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir); |
131 if (!user_data_dir.empty()) { | 131 if (!user_data_dir.empty()) { |
132 // Make sure user_data_dir is an absolute path. | 132 // Make sure user_data_dir is an absolute path. |
133 if (file_util::AbsolutePath(&user_data_dir) && | 133 if (file_util::AbsolutePath(&user_data_dir) && |
134 file_util::PathExists(FilePath::FromWStringHack(user_data_dir))) { | 134 file_util::PathExists(user_data_dir)) { |
135 // TODO(evanm): use CommandLine APIs instead of this. | 135 // TODO(evanm): use CommandLine APIs instead of this. |
136 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + | 136 arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + |
137 L"=\"" + user_data_dir + L"\" "; | 137 L"=\"" + user_data_dir + L"\" "; |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 // Use '--app=url' instead of just 'url' to launch the browser with minimal | 141 // Use '--app=url' instead of just 'url' to launch the browser with minimal |
142 // chrome. | 142 // chrome. |
143 // Note: Do not change this flag! Old Gears shortcuts will break if you do! | 143 // Note: Do not change this flag! Old Gears shortcuts will break if you do! |
144 std::string url_string(url); | 144 std::string url_string(url); |
(...skipping 15 matching lines...) Expand all Loading... |
160 // Host functions shared by browser and plugin processes | 160 // Host functions shared by browser and plugin processes |
161 // | 161 // |
162 | 162 |
163 void* STDCALL CPB_Alloc(uint32 size) { | 163 void* STDCALL CPB_Alloc(uint32 size) { |
164 return malloc(size); | 164 return malloc(size); |
165 } | 165 } |
166 | 166 |
167 void STDCALL CPB_Free(void* memory) { | 167 void STDCALL CPB_Free(void* memory) { |
168 free(memory); | 168 free(memory); |
169 } | 169 } |
OLD | NEW |