| 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_activex.h" | 5 #include "chrome_frame/chrome_frame_activex.h" |
| 6 | 6 |
| 7 #include <wininet.h> | 7 #include <wininet.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return S_OK; | 35 return S_OK; |
| 36 } | 36 } |
| 37 | 37 |
| 38 ChromeFrameActivex::~ChromeFrameActivex() { | 38 ChromeFrameActivex::~ChromeFrameActivex() { |
| 39 // We expect these to be released during a call to SetClientSite(NULL). | 39 // We expect these to be released during a call to SetClientSite(NULL). |
| 40 DCHECK(onmessage_.size() == 0); | 40 DCHECK(onmessage_.size() == 0); |
| 41 DCHECK(onloaderror_.size() == 0); | 41 DCHECK(onloaderror_.size() == 0); |
| 42 DCHECK(onload_.size() == 0); | 42 DCHECK(onload_.size() == 0); |
| 43 DCHECK(onreadystatechanged_.size() == 0); | 43 DCHECK(onreadystatechanged_.size() == 0); |
| 44 DCHECK(onextensionready_.size() == 0); | 44 DCHECK(onextensionready_.size() == 0); |
| 45 |
| 46 // ChromeFramePlugin::Uninitialize() |
| 47 Base::Uninitialize(); |
| 45 } | 48 } |
| 46 | 49 |
| 47 LRESULT ChromeFrameActivex::OnCreate(UINT message, WPARAM wparam, LPARAM lparam, | 50 LRESULT ChromeFrameActivex::OnCreate(UINT message, WPARAM wparam, LPARAM lparam, |
| 48 BOOL& handled) { | 51 BOOL& handled) { |
| 49 Base::OnCreate(message, wparam, lparam, handled); | 52 Base::OnCreate(message, wparam, lparam, handled); |
| 50 return 0; | 53 return 0; |
| 51 } | 54 } |
| 52 | 55 |
| 53 HRESULT ChromeFrameActivex::GetContainingDocument(IHTMLDocument2** doc) { | 56 HRESULT ChromeFrameActivex::GetContainingDocument(IHTMLDocument2** doc) { |
| 54 ScopedComPtr<IOleContainer> container; | 57 ScopedComPtr<IOleContainer> container; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 if (!automated_functions.empty()) | 311 if (!automated_functions.empty()) |
| 309 SplitString(automated_functions, ',', &functions_enabled_); | 312 SplitString(automated_functions, ',', &functions_enabled_); |
| 310 } | 313 } |
| 311 | 314 |
| 312 ScopedBstr profile_name_arg; | 315 ScopedBstr profile_name_arg; |
| 313 service_hr = service->GetChromeProfileName(profile_name_arg.Receive()); | 316 service_hr = service->GetChromeProfileName(profile_name_arg.Receive()); |
| 314 if (S_OK == service_hr && profile_name_arg) | 317 if (S_OK == service_hr && profile_name_arg) |
| 315 profile_name.assign(profile_name_arg, profile_name_arg.Length()); | 318 profile_name.assign(profile_name_arg, profile_name_arg.Length()); |
| 316 } | 319 } |
| 317 | 320 |
| 321 url_fetcher_.set_frame_busting(!is_privileged_); |
| 322 automation_client_->SetUrlFetcher(&url_fetcher_); |
| 318 if (!InitializeAutomation(profile_name, chrome_extra_arguments, | 323 if (!InitializeAutomation(profile_name, chrome_extra_arguments, |
| 319 IsIEInPrivate())) { | 324 IsIEInPrivate())) { |
| 320 return E_FAIL; | 325 return E_FAIL; |
| 321 } | 326 } |
| 322 } | 327 } |
| 323 | 328 |
| 324 return hr; | 329 return hr; |
| 325 } | 330 } |
| 326 | 331 |
| 327 HRESULT ChromeFrameActivex::GetObjectScriptId(IHTMLObjectElement* object_elem, | 332 HRESULT ChromeFrameActivex::GetObjectScriptId(IHTMLObjectElement* object_elem, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 it != handlers.end(); | 442 it != handlers.end(); |
| 438 ++it) { | 443 ++it) { |
| 439 HRESULT hr = (*it)->Invoke(DISPID_VALUE, IID_NULL, LOCALE_USER_DEFAULT, | 444 HRESULT hr = (*it)->Invoke(DISPID_VALUE, IID_NULL, LOCALE_USER_DEFAULT, |
| 440 DISPATCH_METHOD, ¶ms, NULL, NULL, NULL); | 445 DISPATCH_METHOD, ¶ms, NULL, NULL, NULL); |
| 441 // 0x80020101 == SCRIPT_E_REPORTED. | 446 // 0x80020101 == SCRIPT_E_REPORTED. |
| 442 // When the script we're invoking has an error, we get this error back. | 447 // When the script we're invoking has an error, we get this error back. |
| 443 DLOG_IF(ERROR, FAILED(hr) && hr != 0x80020101) | 448 DLOG_IF(ERROR, FAILED(hr) && hr != 0x80020101) |
| 444 << StringPrintf(L"Failed to invoke script: 0x%08X", hr); | 449 << StringPrintf(L"Failed to invoke script: 0x%08X", hr); |
| 445 } | 450 } |
| 446 } | 451 } |
| OLD | NEW |