blob: aba97d10858d1d670ed11cae38b3a8218fcf98d2 [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, )
[email protected]326d3b72011-03-29 20:38:2420 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_MoveWindow, )
[email protected]f7817822009-09-24 05:11:5821 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_ForwardMessageToExternalHost, )
22 IPC_MESSAGE_HANDLER_GENERIC(
23 AutomationMsg_ForwardContextMenuToExternalHost, )
24 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestStart, )
25 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestRead, )
26 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestEnd, )
[email protected]fc6fb7fb2009-11-07 02:35:0427 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_DownloadRequestInHost, )
[email protected]f7817822009-09-24 05:11:5828 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_SetCookieAsync, )
29 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_AttachExternalTab, )
[email protected]f9cc4c452009-10-13 14:56:3830 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_RequestGoToHistoryEntryOffset, )
[email protected]70daf0b2010-03-02 19:13:0031 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_GetCookiesFromHost, )
[email protected]e16dd1672010-06-07 21:40:2932 IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_CloseExternalTab, )
[email protected]f7817822009-09-24 05:11:5833 IPC_MESSAGE_UNHANDLED(is_tab_message = false);
34 IPC_END_MESSAGE_MAP()
35
[email protected]f7817822009-09-24 05:11:5836 return is_tab_message;
37}
38
[email protected]a95986a82010-12-24 06:19:2839bool ChromeFrameDelegateImpl::OnMessageReceived(const IPC::Message& msg) {
[email protected]f7817822009-09-24 05:11:5840 if (!IsValid()) {
41 DLOG(WARNING) << __FUNCTION__
42 << " Msgs received for a NULL automation client instance";
[email protected]a95986a82010-12-24 06:19:2843 return false;
[email protected]f7817822009-09-24 05:11:5844 }
45
[email protected]a95986a82010-12-24 06:19:2846 bool handled = true;
[email protected]f7817822009-09-24 05:11:5847 IPC_BEGIN_MESSAGE_MAP(ChromeFrameDelegateImpl, msg)
48 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged,
49 OnNavigationStateChanged)
50 IPC_MESSAGE_HANDLER(AutomationMsg_UpdateTargetUrl, OnUpdateTargetUrl)
51 IPC_MESSAGE_HANDLER(AutomationMsg_HandleAccelerator,
52 OnAcceleratorPressed)
53 IPC_MESSAGE_HANDLER(AutomationMsg_TabbedOut, OnTabbedOut)
54 IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL)
55 IPC_MESSAGE_HANDLER(AutomationMsg_NavigationFailed, OnNavigationFailed)
56 IPC_MESSAGE_HANDLER(AutomationMsg_DidNavigate, OnDidNavigate)
57 IPC_MESSAGE_HANDLER(AutomationMsg_TabLoaded, OnLoad)
[email protected]326d3b72011-03-29 20:38:2458 IPC_MESSAGE_HANDLER(AutomationMsg_MoveWindow, OnMoveWindow)
[email protected]f7817822009-09-24 05:11:5859 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardMessageToExternalHost,
60 OnMessageFromChromeFrame)
61 IPC_MESSAGE_HANDLER(AutomationMsg_ForwardContextMenuToExternalHost,
62 OnHandleContextMenu)
63 IPC_MESSAGE_HANDLER(AutomationMsg_RequestStart, OnRequestStart)
64 IPC_MESSAGE_HANDLER(AutomationMsg_RequestRead, OnRequestRead)
65 IPC_MESSAGE_HANDLER(AutomationMsg_RequestEnd, OnRequestEnd)
[email protected]fc6fb7fb2009-11-07 02:35:0466 IPC_MESSAGE_HANDLER(AutomationMsg_DownloadRequestInHost,
67 OnDownloadRequestInHost)
[email protected]f7817822009-09-24 05:11:5868 IPC_MESSAGE_HANDLER(AutomationMsg_SetCookieAsync, OnSetCookieAsync)
69 IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab)
[email protected]f9cc4c452009-10-13 14:56:3870 IPC_MESSAGE_HANDLER(AutomationMsg_RequestGoToHistoryEntryOffset,
71 OnGoToHistoryEntryOffset)
[email protected]efd4dfc22010-03-26 20:14:4072 IPC_MESSAGE_HANDLER(AutomationMsg_GetCookiesFromHost, OnGetCookiesFromHost)
[email protected]e16dd1672010-06-07 21:40:2973 IPC_MESSAGE_HANDLER(AutomationMsg_CloseExternalTab, OnCloseTab)
[email protected]a95986a82010-12-24 06:19:2874 IPC_MESSAGE_UNHANDLED(handled = false)
[email protected]f7817822009-09-24 05:11:5875 IPC_END_MESSAGE_MAP()
[email protected]a95986a82010-12-24 06:19:2876
77 return handled;
[email protected]f7817822009-09-24 05:11:5878}