blob: 28e631f7057e699e7a3ba0657d2c47323e76a401 [file] [log] [blame]
[email protected]f7817822009-09-24 05:11:581// 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
[email protected]a22f7e02011-02-09 07:15:357#include "chrome/common/automation_messages.h"
8
[email protected]f5494d42010-12-23 22:15:349bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message) {
[email protected]f7817822009-09-24 05:11:5810 bool is_tab_message = true;
11 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, message)
12 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationStateChanged, )
13 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_UpdateTargetUrl, )
14 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_HandleAccelerator, )
15 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabbedOut, )
16 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_OpenURL, )
17 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_NavigationFailed, )
18 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DidNavigate, )
19 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_TabLoaded, )
20 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, )
21 IPC_MESSAGE_HANDLER_GENERIC(
22 AutomationMsg_ForwardContextMenuToExternalHost, )
23 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, )
24 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, )
25 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, )
[email protected]fc6fb7fb2009-11-07 02:35:0426 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, )
[email protected]f7817822009-09-24 05:11:5827 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, )
28 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, )
[email protected]f9cc4c452009-10-13 14:56:3829 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, )
[email protected]70daf0b2010-03-02 19:13:0030 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, )
[email protected]e16dd1672010-06-07 21:40:2931 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, )
[email protected]f7817822009-09-24 05:11:5832 IPC_MESSAGE_UNHANDLED(is_tab_message = false);
33 IPC_END_MESSAGE_MAP()
34
[email protected]f7817822009-09-24 05:11:5835 return is_tab_message;
36}
37
[email protected]a95986a82010-12-24 06:19:2838bool ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) {
[email protected]f7817822009-09-24 05:11:5839 if (!IsValid()) {
40 DLOG(WARNING) << __FUNCTION__
41 << " Msgs received for a NULL automation client instance";
[email protected]a95986a82010-12-24 06:19:2842 return false;
[email protected]f7817822009-09-24 05:11:5843 }
44
[email protected]a95986a82010-12-24 06:19:2845 bool handled = true;
[email protected]f7817822009-09-24 05:11:5846 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)
[email protected]fc6fb7fb2009-11-07 02:35:0464 IPC_MESSAGE_HANDLER(AutomationMsg_DownloadRequestInHost,
65 OnDownloadRequestInHost)
[email protected]f7817822009-09-24 05:11:5866 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync)
67 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab)
[email protected]f9cc4c452009-10-13 14:56:3868 IPC_MESSAGE_HANDLER(AutomationMsg_RequestGoToHistoryEntryOffset,
69 OnGoToHistoryEntryOffset)
[email protected]efd4dfc22010-03-26 20:14:4070 IPC_MESSAGE_HANDLER(AutomationMsg_GetCookiesFromHost, OnGetCookiesFromHost)
[email protected]e16dd1672010-06-07 21:40:2971 IPC_MESSAGE_HANDLER(AutomationMsg_CloseExternalTab, OnCloseTab)
[email protected]a95986a82010-12-24 06:19:2872 IPC_MESSAGE_UNHANDLED(handled = false)
[email protected]f7817822009-09-24 05:11:5873 IPC_END_MESSAGE_MAP()
[email protected]a95986a82010-12-24 06:19:2874
75 return handled;
[email protected]f7817822009-09-24 05:11:5876}