| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/com_message_event.h" | 5 #include "chrome_frame/com_message_event.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return hr; | 101 return hr; |
| 102 } | 102 } |
| 103 | 103 |
| 104 STDMETHODIMP ComMessageEvent::Invoke(DISPID dispid, REFIID iid, LCID lcid, | 104 STDMETHODIMP ComMessageEvent::Invoke(DISPID dispid, REFIID iid, LCID lcid, |
| 105 WORD flags, DISPPARAMS* params, | 105 WORD flags, DISPPARAMS* params, |
| 106 VARIANT* result, EXCEPINFO* excepinfo, | 106 VARIANT* result, EXCEPINFO* excepinfo, |
| 107 UINT* arg_err) { | 107 UINT* arg_err) { |
| 108 HRESULT hr = DISP_E_MEMBERNOTFOUND; | 108 HRESULT hr = DISP_E_MEMBERNOTFOUND; |
| 109 switch (dispid) { | 109 switch (dispid) { |
| 110 case DISPID_MESSAGE_EVENT_DATA: | 110 case DISPID_MESSAGE_EVENT_DATA: |
| 111 hr = GetStringProperty(flags, UTF8ToWide(message_).c_str(), result); | 111 hr = GetStringProperty(flags, base::UTF8ToWide(message_).c_str(), result); |
| 112 break; | 112 break; |
| 113 | 113 |
| 114 case DISPID_MESSAGE_EVENT_ORIGIN: | 114 case DISPID_MESSAGE_EVENT_ORIGIN: |
| 115 hr = GetStringProperty(flags, UTF8ToWide(origin_).c_str(), result); | 115 hr = GetStringProperty(flags, base::UTF8ToWide(origin_).c_str(), result); |
| 116 break; | 116 break; |
| 117 | 117 |
| 118 case DISPID_MESSAGE_EVENT_TYPE: | 118 case DISPID_MESSAGE_EVENT_TYPE: |
| 119 hr = GetStringProperty(flags, UTF8ToWide(type_).c_str(), result); | 119 hr = GetStringProperty(flags, base::UTF8ToWide(type_).c_str(), result); |
| 120 break; | 120 break; |
| 121 | 121 |
| 122 case DISPID_MESSAGE_EVENT_LAST_EVENT_ID: | 122 case DISPID_MESSAGE_EVENT_LAST_EVENT_ID: |
| 123 hr = GetStringProperty(flags, L"", result); | 123 hr = GetStringProperty(flags, L"", result); |
| 124 break; | 124 break; |
| 125 | 125 |
| 126 case DISPID_MESSAGE_EVENT_SOURCE: | 126 case DISPID_MESSAGE_EVENT_SOURCE: |
| 127 case DISPID_MESSAGE_EVENT_MESSAGE_PORT: | 127 case DISPID_MESSAGE_EVENT_MESSAGE_PORT: |
| 128 if (flags & DISPATCH_PROPERTYGET) { | 128 if (flags & DISPATCH_PROPERTYGET) { |
| 129 result->vt = VT_NULL; | 129 result->vt = VT_NULL; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 152 HRESULT hr; | 152 HRESULT hr; |
| 153 if (flags & DISPATCH_PROPERTYGET) { | 153 if (flags & DISPATCH_PROPERTYGET) { |
| 154 result->vt = VT_BSTR; | 154 result->vt = VT_BSTR; |
| 155 result->bstrVal = ::SysAllocString(value); | 155 result->bstrVal = ::SysAllocString(value); |
| 156 hr = S_OK; | 156 hr = S_OK; |
| 157 } else { | 157 } else { |
| 158 hr = DISP_E_TYPEMISMATCH; | 158 hr = DISP_E_TYPEMISMATCH; |
| 159 } | 159 } |
| 160 return hr; | 160 return hr; |
| 161 } | 161 } |
| OLD | NEW |