OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // ICeeeBroker implementation | 5 // ICeeeBroker implementation |
6 | 6 |
7 #include "ceee/ie/broker/broker.h" | 7 #include "ceee/ie/broker/broker.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ceee/ie/broker/api_dispatcher.h" | 10 #include "ceee/ie/broker/api_dispatcher.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 return S_OK; | 21 return S_OK; |
22 } | 22 } |
23 | 23 |
24 STDMETHODIMP CeeeBroker::Execute(BSTR function, BSTR* response) { | 24 STDMETHODIMP CeeeBroker::Execute(BSTR function, BSTR* response) { |
25 // This is DEPRECATED and we should use ChromePostman (see FireEvent). | 25 // This is DEPRECATED and we should use ChromePostman (see FireEvent). |
26 api_dispatcher_->HandleApiRequest(function, response); | 26 api_dispatcher_->HandleApiRequest(function, response); |
27 return S_OK; | 27 return S_OK; |
28 } | 28 } |
29 | 29 |
30 STDMETHODIMP CeeeBroker::FireEvent(BSTR event_name, BSTR event_args) { | 30 STDMETHODIMP CeeeBroker::FireEvent(BSTR event_name, BSTR event_args) { |
31 ChromePostman::GetInstance()->FireEvent(event_name, event_args); | 31 ChromePostman::GetInstance()->FireEvent(CW2A(event_name), CW2A(event_args)); |
Sigurður Ásgeirsson
2010/11/19 18:29:30
A NULL BSTR is synonymous with the empty string, s
Vitaly Buka corp
2010/11/19 20:30:38
Done.
| |
32 return S_OK; | 32 return S_OK; |
33 } | 33 } |
34 | 34 |
35 STDMETHODIMP CeeeBroker::RegisterWindowExecutor(long thread_id, | 35 STDMETHODIMP CeeeBroker::RegisterWindowExecutor(long thread_id, |
36 IUnknown* executor) { | 36 IUnknown* executor) { |
37 // TODO(mad@chromium.org): Add security check here. | 37 // TODO(mad@chromium.org): Add security check here. |
38 return executors_manager_->RegisterWindowExecutor(thread_id, executor); | 38 return executors_manager_->RegisterWindowExecutor(thread_id, executor); |
39 } | 39 } |
40 | 40 |
41 STDMETHODIMP CeeeBroker::UnregisterExecutor(long thread_id) { | 41 STDMETHODIMP CeeeBroker::UnregisterExecutor(long thread_id) { |
42 // TODO(mad@chromium.org): Add security check here. | 42 // TODO(mad@chromium.org): Add security check here. |
43 return executors_manager_->RemoveExecutor(thread_id); | 43 return executors_manager_->RemoveExecutor(thread_id); |
44 } | 44 } |
45 | 45 |
46 STDMETHODIMP CeeeBroker::RegisterTabExecutor(long thread_id, | 46 STDMETHODIMP CeeeBroker::RegisterTabExecutor(long thread_id, |
47 IUnknown* executor) { | 47 IUnknown* executor) { |
48 // TODO(mad@chromium.org): Implement the proper manual/secure registration. | 48 // TODO(mad@chromium.org): Implement the proper manual/secure registration. |
49 return executors_manager_->RegisterTabExecutor(thread_id, executor); | 49 return executors_manager_->RegisterTabExecutor(thread_id, executor); |
50 } | 50 } |
51 | 51 |
52 STDMETHODIMP CeeeBroker::SetTabIdForHandle(long tab_id, | 52 STDMETHODIMP CeeeBroker::SetTabIdForHandle(long tab_id, |
53 CeeeWindowHandle handle) { | 53 CeeeWindowHandle handle) { |
54 // TODO(mad@chromium.org): Add security check here. | 54 // TODO(mad@chromium.org): Add security check here. |
55 DCHECK(tab_id != kInvalidChromeSessionId && | 55 DCHECK(tab_id != kInvalidChromeSessionId && |
56 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE)); | 56 handle != reinterpret_cast<CeeeWindowHandle>(INVALID_HANDLE_VALUE)); |
57 executors_manager_->SetTabIdForHandle(tab_id, reinterpret_cast<HWND>(handle)); | 57 executors_manager_->SetTabIdForHandle(tab_id, reinterpret_cast<HWND>(handle)); |
58 return S_OK; | 58 return S_OK; |
59 } | 59 } |
OLD | NEW |