OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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/chrome_frame_delegate.h" | 5 #include "chrome_frame/chrome_frame_delegate.h" |
6 | 6 |
7 bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message, | 7 bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message) { |
8 int* tab_handle) { | |
9 bool is_tab_message = true; | 8 bool is_tab_message = true; |
10 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message) | 9 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message) |
11 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, ) | 10 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, ) |
12 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, ) | 11 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, ) |
13 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, ) | 12 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, ) |
14 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, ) | 13 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, ) |
15 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, ) | 14 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, ) |
16 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, ) | 15 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, ) |
17 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, ) | 16 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, ) |
18 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, ) | 17 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, ) |
19 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, ) | 18 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, ) |
20 IPC_MESSAGE_HANDLER_GENERIC( | 19 IPC_MESSAGE_HANDLER_GENERIC( |
21 AutomationMsg_ForwardContextMenuToExternalHost, ) | 20 AutomationMsg_ForwardContextMenuToExternalHost, ) |
22 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, ) | 21 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, ) |
23 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, ) | 22 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, ) |
24 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, ) | 23 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, ) |
25 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, ) | 24 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, ) |
26 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, ) | 25 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, ) |
27 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, ) | 26 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, ) |
28 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, ) | 27 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, ) |
29 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, ) | 28 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, ) |
30 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, ) | 29 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, ) |
31 IPC_MESSAGE_UNHANDLED(is_tab_message = false); | 30 IPC_MESSAGE_UNHANDLED(is_tab_message = false); |
32 IPC_END_MESSAGE_MAP() | 31 IPC_END_MESSAGE_MAP() |
33 | 32 |
34 if (is_tab_message) { | |
35 // Read tab handle from the message. | |
36 void* iter = NULL; | |
37 is_tab_message = message.ReadInt(&iter, tab_handle); | |
38 } | |
39 | |
40 return is_tab_message; | 33 return is_tab_message; |
41 } | 34 } |
42 | 35 |
43 void ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) { | 36 void ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) { |
44 if (!IsValid()) { | 37 if (!IsValid()) { |
45 DLOG(WARNING) << __FUNCTION__ | 38 DLOG(WARNING) << __FUNCTION__ |
46 << " Msgs received for a NULL automation client instance"; | 39 << " Msgs received for a NULL automation client instance"; |
47 return; | 40 return; |
48 } | 41 } |
49 | 42 |
(...skipping 18 matching lines...) Expand all Loading... |
68 IPC_MESSAGE_HANDLER(AutomationMsg_DownloadRequestInHost, | 61 IPC_MESSAGE_HANDLER(AutomationMsg_DownloadRequestInHost, |
69 OnDownloadRequestInHost) | 62 OnDownloadRequestInHost) |
70 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync) | 63 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync) |
71 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) | 64 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) |
72 IPC_MESSAGE_HANDLER(AutomationMsg_RequestGoToHistoryEntryOffset, | 65 IPC_MESSAGE_HANDLER(AutomationMsg_RequestGoToHistoryEntryOffset, |
73 OnGoToHistoryEntryOffset) | 66 OnGoToHistoryEntryOffset) |
74 IPC_MESSAGE_HANDLER(AutomationMsg_GetCookiesFromHost, OnGetCookiesFromHost) | 67 IPC_MESSAGE_HANDLER(AutomationMsg_GetCookiesFromHost, OnGetCookiesFromHost) |
75 IPC_MESSAGE_HANDLER(AutomationMsg_CloseExternalTab, OnCloseTab) | 68 IPC_MESSAGE_HANDLER(AutomationMsg_CloseExternalTab, OnCloseTab) |
76 IPC_END_MESSAGE_MAP() | 69 IPC_END_MESSAGE_MAP() |
77 } | 70 } |
OLD | NEW |