| OLD | NEW |
| 1 // Copyright (c) 2010 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/cfproxy_private.h" | 5 #include "chrome_frame/cfproxy_private.h" |
| 6 | 6 |
| 7 #include "base/tuple.h" | 7 #include "base/tuple.h" |
| 8 #include "ipc/ipc_sync_message.h" | 8 #include "ipc/ipc_sync_message.h" |
| 9 #include "chrome/common/automation_messages.h" | 9 #include "chrome/common/automation_messages.h" |
| 10 | 10 |
| 11 CFProxy::CFProxy(CFProxyTraits* api) : ipc_thread_("ipc"), | 11 CFProxy::CFProxy(CFProxyTraits* api) : ipc_thread_("ipc"), |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DCHECK(CalledOnIpcThread()); | 118 DCHECK(CalledOnIpcThread()); |
| 119 if (ipc_sender_) { | 119 if (ipc_sender_) { |
| 120 ipc_sender_->Send(m); | 120 ipc_sender_->Send(m); |
| 121 } else { | 121 } else { |
| 122 delete m; | 122 delete m; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 | 125 |
| 126 ////////////////////////////////////////////////////////////////////////// | 126 ////////////////////////////////////////////////////////////////////////// |
| 127 // Sync messages. | 127 // Sync messages. |
| 128 void CFProxy::InstallExtension(ChromeProxyDelegate* delegate, | |
| 129 const FilePath& crx_path, | |
| 130 SyncMessageContext* ctx) { | |
| 131 IPC::SyncMessage* m = new AutomationMsg_InstallExtension(crx_path, NULL); | |
| 132 sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); | |
| 133 SendIpcMessage(m); | |
| 134 } | |
| 135 | |
| 136 void CFProxy::LoadExtension(ChromeProxyDelegate* delegate, | |
| 137 const FilePath& path, SyncMessageContext* ctx) { | |
| 138 IPC::SyncMessage* m = new AutomationMsg_LoadExpandedExtension(path, 0); | |
| 139 sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); | |
| 140 SendIpcMessage(m); | |
| 141 } | |
| 142 | |
| 143 void CFProxy::GetEnabledExtensions(ChromeProxyDelegate* delegate, | |
| 144 SyncMessageContext* ctx) { | |
| 145 IPC::SyncMessage* m = new AutomationMsg_GetEnabledExtensions(NULL); | |
| 146 sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); | |
| 147 SendIpcMessage(m); | |
| 148 } | |
| 149 | |
| 150 void CFProxy::Tab_Find(int tab, const string16& search_string, | 128 void CFProxy::Tab_Find(int tab, const string16& search_string, |
| 151 FindInPageDirection forward, FindInPageCase match_case, | 129 FindInPageDirection forward, FindInPageCase match_case, |
| 152 bool find_next) { | 130 bool find_next) { |
| 153 AutomationMsg_Find_Params params; | 131 AutomationMsg_Find_Params params; |
| 154 params.unused = 0; | 132 params.unused = 0; |
| 155 params.search_string = search_string; | 133 params.search_string = search_string; |
| 156 params.find_next = find_next; | 134 params.find_next = find_next; |
| 157 params.match_case = (match_case == CASE_SENSITIVE); | 135 params.match_case = (match_case == CASE_SENSITIVE); |
| 158 params.forward = (forward == FWD); | 136 params.forward = (forward == FWD); |
| 159 IPC::SyncMessage* m = new AutomationMsg_Find(tab, params, NULL, NULL); | 137 IPC::SyncMessage* m = new AutomationMsg_Find(tab, params, NULL, NULL); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void CFProxy::OnChannelError() { | 213 void CFProxy::OnChannelError() { |
| 236 is_connected_ = false; | 214 is_connected_ = false; |
| 237 | 215 |
| 238 // Inform the sync message callbacks that there are not going to see | 216 // Inform the sync message callbacks that there are not going to see |
| 239 // any reply. | 217 // any reply. |
| 240 sync_dispatcher_.OnChannelClosed(); | 218 sync_dispatcher_.OnChannelClosed(); |
| 241 OnPeerLost(ChromeProxyDelegate::CHANNEL_ERROR); | 219 OnPeerLost(ChromeProxyDelegate::CHANNEL_ERROR); |
| 242 | 220 |
| 243 // TODO(stoyan): Relaunch? | 221 // TODO(stoyan): Relaunch? |
| 244 } | 222 } |
| OLD | NEW |