Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3926)

Unified Diff: chrome_frame/com_message_event.cc

Issue 126143005: Remove Chrome Frame code and resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to r244038 Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/com_message_event.h ('k') | chrome_frame/com_type_info_holder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/com_message_event.cc
diff --git a/chrome_frame/com_message_event.cc b/chrome_frame/com_message_event.cc
deleted file mode 100644
index d122f8c9317808b4116ef0a99e0e90764bcbaeb5..0000000000000000000000000000000000000000
--- a/chrome_frame/com_message_event.cc
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome_frame/com_message_event.h"
-
-#include "base/logging.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-
-ComMessageEvent::ComMessageEvent() {
-}
-
-ComMessageEvent::~ComMessageEvent() {
-}
-
-bool ComMessageEvent::Initialize(IOleContainer* container,
- const std::string& message,
- const std::string& origin,
- const std::string& event_type) {
- DLOG_IF(WARNING, !container) << __FUNCTION__ << " no container";
- message_ = message;
- origin_ = origin;
- type_ = event_type;
-
- // May remain NULL if container not IE
- base::win::ScopedComPtr<IHTMLEventObj> basic_event;
- base::win::ScopedComPtr<IHTMLDocument2> doc;
-
- // Fetching doc may fail in non-IE containers
- // and container might be NULL in some applications.
- if (container)
- container->QueryInterface(doc.Receive());
- if (doc) {
- base::win::ScopedComPtr<IHTMLDocument4> doc4;
- doc4.QueryFrom(doc);
- DCHECK(doc4); // supported by IE5.5 and higher
- if (doc4) {
- // IHTMLEventObj5 is only supported in IE8 and later, so we provide our
- // own (minimalistic) implementation of it.
- doc4->createEventObject(NULL, basic_event.Receive());
- DCHECK(basic_event);
- }
- }
-
- basic_event_ = basic_event;
- return true;
-}
-
-STDMETHODIMP ComMessageEvent::GetTypeInfoCount(UINT* info) {
- // Don't DCHECK as python scripts might still call this function
- // inadvertently.
- DLOG(WARNING) << "Not implemented: " << __FUNCTION__;
- return E_NOTIMPL;
-}
-
-STDMETHODIMP ComMessageEvent::GetTypeInfo(UINT which_info, LCID lcid,
- ITypeInfo** type_info) {
- DLOG(WARNING) << "Not implemented: " << __FUNCTION__;
- return E_NOTIMPL;
-}
-
-STDMETHODIMP ComMessageEvent::GetIDsOfNames(REFIID iid, LPOLESTR* names,
- UINT count_names, LCID lcid,
- DISPID* dispids) {
- HRESULT hr = S_OK;
-
- // Note that since we're using LowerCaseEqualsASCII for string comparison,
- // the second argument _must_ be all lower case. I.e. we cannot compare
- // against L"messagePort" since it has a capital 'P'.
- for (UINT i = 0; SUCCEEDED(hr) && i < count_names; ++i) {
- const wchar_t* name_begin = names[i];
- const wchar_t* name_end = name_begin + wcslen(name_begin);
- if (LowerCaseEqualsASCII(name_begin, name_end, "data")) {
- dispids[i] = DISPID_MESSAGE_EVENT_DATA;
- } else if (LowerCaseEqualsASCII(name_begin, name_end, "origin")) {
- dispids[i] = DISPID_MESSAGE_EVENT_ORIGIN;
- } else if (LowerCaseEqualsASCII(name_begin, name_end, "lasteventid")) {
- dispids[i] = DISPID_MESSAGE_EVENT_LAST_EVENT_ID;
- } else if (LowerCaseEqualsASCII(name_begin, name_end, "source")) {
- dispids[i] = DISPID_MESSAGE_EVENT_SOURCE;
- } else if (LowerCaseEqualsASCII(name_begin, name_end, "messageport")) {
- dispids[i] = DISPID_MESSAGE_EVENT_MESSAGE_PORT;
- } else if (LowerCaseEqualsASCII(name_begin, name_end, "type")) {
- dispids[i] = DISPID_MESSAGE_EVENT_TYPE;
- } else {
- if (basic_event_) {
- hr = basic_event_->GetIDsOfNames(IID_IDispatch, &names[i], 1, lcid,
- &dispids[i]);
- } else {
- hr = DISP_E_MEMBERNOTFOUND;
- }
-
- if (FAILED(hr)) {
- DLOG(WARNING) << "member not found: " << names[i]
- << base::StringPrintf(L"0x%08X", hr);
- }
- }
- }
- return hr;
-}
-
-STDMETHODIMP ComMessageEvent::Invoke(DISPID dispid, REFIID iid, LCID lcid,
- WORD flags, DISPPARAMS* params,
- VARIANT* result, EXCEPINFO* excepinfo,
- UINT* arg_err) {
- HRESULT hr = DISP_E_MEMBERNOTFOUND;
- switch (dispid) {
- case DISPID_MESSAGE_EVENT_DATA:
- hr = GetStringProperty(flags, base::UTF8ToWide(message_).c_str(), result);
- break;
-
- case DISPID_MESSAGE_EVENT_ORIGIN:
- hr = GetStringProperty(flags, base::UTF8ToWide(origin_).c_str(), result);
- break;
-
- case DISPID_MESSAGE_EVENT_TYPE:
- hr = GetStringProperty(flags, base::UTF8ToWide(type_).c_str(), result);
- break;
-
- case DISPID_MESSAGE_EVENT_LAST_EVENT_ID:
- hr = GetStringProperty(flags, L"", result);
- break;
-
- case DISPID_MESSAGE_EVENT_SOURCE:
- case DISPID_MESSAGE_EVENT_MESSAGE_PORT:
- if (flags & DISPATCH_PROPERTYGET) {
- result->vt = VT_NULL;
- hr = S_OK;
- } else {
- hr = DISP_E_TYPEMISMATCH;
- }
- break;
-
- default:
- if (basic_event_) {
- hr = basic_event_->Invoke(dispid, iid, lcid, flags, params, result,
- excepinfo, arg_err);
- }
- break;
- }
-
- return hr;
-}
-
-HRESULT ComMessageEvent::GetStringProperty(WORD flags, const wchar_t* value,
- VARIANT* result) {
- if (!result)
- return E_INVALIDARG;
-
- HRESULT hr;
- if (flags & DISPATCH_PROPERTYGET) {
- result->vt = VT_BSTR;
- result->bstrVal = ::SysAllocString(value);
- hr = S_OK;
- } else {
- hr = DISP_E_TYPEMISMATCH;
- }
- return hr;
-}
« no previous file with comments | « chrome_frame/com_message_event.h ('k') | chrome_frame/com_type_info_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698