OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome_frame/chrome_frame_delegate.h" |
| 6 |
| 7 bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message, |
| 8 int* tab_handle) { |
| 9 bool is_tab_message = true; |
| 10 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message) |
| 11 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, ) |
| 12 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, ) |
| 13 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, ) |
| 14 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, ) |
| 15 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, ) |
| 16 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, ) |
| 17 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, ) |
| 18 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, ) |
| 19 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, ) |
| 20 IPC_MESSAGE_HANDLER_GENERIC( |
| 21 AutomationMsg_ForwardContextMenuToExternalHost, ) |
| 22 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, ) |
| 23 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, ) |
| 24 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, ) |
| 25 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, ) |
| 26 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, ) |
| 27 IPC_MESSAGE_UNHANDLED(is_tab_message = false); |
| 28 IPC_END_MESSAGE_MAP() |
| 29 |
| 30 if (is_tab_message) { |
| 31 // Read tab handle from the message. |
| 32 void* iter = NULL; |
| 33 is_tab_message = message.ReadInt(&iter, tab_handle); |
| 34 } |
| 35 |
| 36 return is_tab_message; |
| 37 } |
| 38 |
| 39 void ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) { |
| 40 if (!IsValid()) { |
| 41 DLOG(WARNING) << __FUNCTION__ |
| 42 << " Msgs received for a NULL automation client instance"; |
| 43 return; |
| 44 } |
| 45 |
| 46 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, msg) |
| 47 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged, |
| 48 OnNavigationStateChanged) |
| 49 IPC_MESSAGE_HANDLER(AutomationMsg_UpdateTargetUrl, OnUpdateTargetUrl) |
| 50 IPC_MESSAGE_HANDLER(AutomationMsg_HandleAccelerator, |
| 51 OnAcceleratorPressed) |
| 52 IPC_MESSAGE_HANDLER(AutomationMsg_TabbedOut, OnTabbedOut) |
| 53 IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL) |
| 54 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationFailed, OnNavigationFailed) |
| 55 IPC_MESSAGE_HANDLER(AutomationMsg_DidNavigate, OnDidNavigate) |
| 56 IPC_MESSAGE_HANDLER(AutomationMsg_TabLoaded, OnLoad) |
| 57 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardMessageToExternalHost, |
| 58 OnMessageFromChromeFrame) |
| 59 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardContextMenuToExternalHost, |
| 60 OnHandleContextMenu) |
| 61 IPC_MESSAGE_HANDLER(AutomationMsg_RequestStart, OnRequestStart) |
| 62 IPC_MESSAGE_HANDLER(AutomationMsg_RequestRead, OnRequestRead) |
| 63 IPC_MESSAGE_HANDLER(AutomationMsg_RequestEnd, OnRequestEnd) |
| 64 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync) |
| 65 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) |
| 66 IPC_END_MESSAGE_MAP() |
| 67 } |
OLD | NEW |