| 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" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 ProxyFactory::ProxyFactory() | 160 ProxyFactory::ProxyFactory() |
| 161 : uma_send_interval_(0) { | 161 : uma_send_interval_(0) { |
| 162 uma_send_interval_ = GetConfigInt(kDefaultSendUMADataInterval, | 162 uma_send_interval_ = GetConfigInt(kDefaultSendUMADataInterval, |
| 163 kUmaSendIntervalValue); | 163 kUmaSendIntervalValue); |
| 164 } | 164 } |
| 165 | 165 |
| 166 ProxyFactory::~ProxyFactory() { | 166 ProxyFactory::~ProxyFactory() { |
| 167 for (size_t i = 0; i < proxies_.container().size(); ++i) { | 167 for (size_t i = 0; i < proxies_.container().size(); ++i) { |
| 168 if (WAIT_OBJECT_0 != | 168 DWORD result = WaitForSingleObject(proxies_[i]->thread->thread_handle(), 0); |
| 169 WaitForSingleObject(proxies_[i]->thread->thread_handle(), 0)) | 169 if (WAIT_OBJECT_0 != result) |
| 170 // TODO(stoyan): Don't leak proxies on exit. | 170 // TODO(stoyan): Don't leak proxies on exit. |
| 171 DLOG(ERROR) << "Proxies leaked on exit."; | 171 DLOG(ERROR) << "Proxies leaked on exit."; |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 void* ProxyFactory::GetAutomationServer(int launch_timeout, | 175 void* ProxyFactory::GetAutomationServer(int launch_timeout, |
| 176 const std::wstring& profile_name, | 176 const std::wstring& profile_name, |
| 177 const std::wstring& extra_argument, | 177 const std::wstring& extra_argument, |
| 178 bool perform_version_check, | 178 bool perform_version_check, |
| 179 LaunchDelegate* delegate) { | 179 LaunchDelegate* delegate) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 chrome_launcher::CreateLaunchCommandLine()); | 238 chrome_launcher::CreateLaunchCommandLine()); |
| 239 command_line->AppendSwitchWithValue(switches::kAutomationClientChannelID, | 239 command_line->AppendSwitchWithValue(switches::kAutomationClientChannelID, |
| 240 ASCIIToWide(proxy->channel_id())); | 240 ASCIIToWide(proxy->channel_id())); |
| 241 | 241 |
| 242 // The metrics bug out because they attempt to use URLFetcher with a | 242 // The metrics bug out because they attempt to use URLFetcher with a |
| 243 // null URLRequestContext::default_request_context_. Turn them off for now. | 243 // null URLRequestContext::default_request_context_. Turn them off for now. |
| 244 // TODO(robertshield): Figure out why this is. It appears to have something | 244 // TODO(robertshield): Figure out why this is. It appears to have something |
| 245 // to do with an improperly set up profile... | 245 // to do with an improperly set up profile... |
| 246 command_line->AppendSwitch(switches::kDisableMetrics); | 246 command_line->AppendSwitch(switches::kDisableMetrics); |
| 247 | 247 |
| 248 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths |
| 249 // and registry keys that Chrome looks in via the BrowserDistribution |
| 250 // mechanism. |
| 251 command_line->AppendSwitch(switches::kChromeFrame); |
| 252 |
| 248 // Chrome Frame never wants Chrome to start up with a First Run UI. | 253 // Chrome Frame never wants Chrome to start up with a First Run UI. |
| 249 command_line->AppendSwitch(switches::kNoFirstRun); | 254 command_line->AppendSwitch(switches::kNoFirstRun); |
| 250 | 255 |
| 251 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very | 256 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very |
| 252 // useful for Chrome Frame users. | 257 // useful for Chrome Frame users. |
| 253 command_line->AppendSwitch(switches::kNoErrorDialogs); | 258 command_line->AppendSwitch(switches::kNoErrorDialogs); |
| 254 | 259 |
| 255 command_line->AppendSwitch(switches::kEnableRendererAccessibility); | 260 command_line->AppendSwitch(switches::kEnableRendererAccessibility); |
| 256 | 261 |
| 257 // Place the profile directory in | 262 // Place the profile directory in |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 if (font_size < SMALLEST_FONT || | 1106 if (font_size < SMALLEST_FONT || |
| 1102 font_size > LARGEST_FONT) { | 1107 font_size > LARGEST_FONT) { |
| 1103 NOTREACHED() << "Invalid font size specified : " | 1108 NOTREACHED() << "Invalid font size specified : " |
| 1104 << font_size; | 1109 << font_size; |
| 1105 return; | 1110 return; |
| 1106 } | 1111 } |
| 1107 | 1112 |
| 1108 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); | 1113 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); |
| 1109 } | 1114 } |
| 1110 | 1115 |
| OLD | NEW |