OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/process_util.h" | 13 #include "base/process_util.h" |
14 #include "base/singleton.h" | 14 #include "base/singleton.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
17 #include "chrome/app/client_util.h" | 17 #include "chrome/app/client_util.h" |
18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_paths_internal.h" |
20 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/test/automation/tab_proxy.h" | 22 #include "chrome/test/automation/tab_proxy.h" |
22 #include "chrome_frame/chrome_launcher.h" | 23 #include "chrome_frame/chrome_launcher.h" |
23 #include "chrome_frame/utils.h" | 24 #include "chrome_frame/utils.h" |
24 #include "chrome_frame/sync_msg_reply_dispatcher.h" | 25 #include "chrome_frame/sync_msg_reply_dispatcher.h" |
25 | 26 |
26 #ifdef NDEBUG | 27 #ifdef NDEBUG |
27 int64 kAutomationServerReasonableLaunchDelay = 1000; // in milliseconds | 28 int64 kAutomationServerReasonableLaunchDelay = 1000; // in milliseconds |
28 #else | 29 #else |
29 int64 kAutomationServerReasonableLaunchDelay = 1000 * 10; | 30 int64 kAutomationServerReasonableLaunchDelay = 1000 * 10; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 245 |
245 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very | 246 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very |
246 // useful for Chrome Frame users. | 247 // useful for Chrome Frame users. |
247 command_line->AppendSwitch(switches::kNoErrorDialogs); | 248 command_line->AppendSwitch(switches::kNoErrorDialogs); |
248 | 249 |
249 command_line->AppendSwitch(switches::kEnableRendererAccessibility); | 250 command_line->AppendSwitch(switches::kEnableRendererAccessibility); |
250 | 251 |
251 // Place the profile directory in | 252 // Place the profile directory in |
252 // "<chrome_exe_path>\..\User Data\<profile-name>" | 253 // "<chrome_exe_path>\..\User Data\<profile-name>" |
253 if (!entry->profile_name.empty()) { | 254 if (!entry->profile_name.empty()) { |
254 std::wstring profile_path; | 255 FilePath profile_path; |
255 if (GetUserProfileBaseDirectory(&profile_path)) { | 256 if (chrome::GetChromeFrameUserDataDirectory(&profile_path)) { |
256 file_util::AppendToPath(&profile_path, entry->profile_name); | 257 profile_path = profile_path.Append(entry->profile_name); |
257 command_line->AppendSwitchWithValue(switches::kUserDataDir, | 258 command_line->AppendSwitchWithValue(switches::kUserDataDir, |
258 profile_path); | 259 profile_path.value()); |
259 } else { | 260 } else { |
260 // Can't get the profile dir :-( We need one to work, so fail. | 261 // Can't get the profile dir :-( We need one to work, so fail. |
261 // We have no code for launch failure. | 262 // We have no code for launch failure. |
262 entry->launch_result = AutomationLaunchResult(-1); | 263 entry->launch_result = AutomationLaunchResult(-1); |
263 } | 264 } |
264 } | 265 } |
265 | 266 |
266 std::wstring command_line_string(command_line->command_line_string()); | 267 std::wstring command_line_string(command_line->command_line_string()); |
267 // If there are any extra arguments, append them to the command line. | 268 // If there are any extra arguments, append them to the command line. |
268 if (!extra_chrome_arguments.empty()) { | 269 if (!extra_chrome_arguments.empty()) { |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 if (font_size < SMALLEST_FONT || | 1097 if (font_size < SMALLEST_FONT || |
1097 font_size > LARGEST_FONT) { | 1098 font_size > LARGEST_FONT) { |
1098 NOTREACHED() << "Invalid font size specified : " | 1099 NOTREACHED() << "Invalid font size specified : " |
1099 << font_size; | 1100 << font_size; |
1100 return; | 1101 return; |
1101 } | 1102 } |
1102 | 1103 |
1103 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); | 1104 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); |
1104 } | 1105 } |
1105 | 1106 |
OLD | NEW |