Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: chrome_frame/chrome_frame_delegate.h

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | chrome_frame/chrome_frame_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef CHROME_FRAME_CHROME_FRAME_DELEGATE_H_
6 #define CHROME_FRAME_CHROME_FRAME_DELEGATE_H_
7
8 #include "chrome/test/automation/automation_messages.h"
9 #include "ipc/ipc_message.h"
10
11 // A common interface supported by all the browser specific ChromeFrame
12 // implementations.
13 class ChromeFrameDelegate {
14 public:
15
16 typedef HWND WindowType;
17
18 virtual WindowType GetWindow() const = 0;
19 virtual void GetBounds(RECT* bounds) = 0;
20 virtual std::string GetDocumentUrl() = 0;
21 virtual void OnAutomationServerReady() = 0;
22 virtual void OnAutomationServerLaunchFailed(
23 AutomationLaunchResult reason, const std::string& server_version) = 0;
24 virtual void OnMessageReceived(const IPC::Message& msg) = 0;
25
26 // This remains in interface since we call it if Navigate()
27 // returns immediate error.
28 virtual void OnLoadFailed(int error_code, const std::string& url) = 0;
29
30 // Returns true if this instance is alive and well for processing automation
31 // messages.
32 virtual bool IsValid() const = 0;
33
34 protected:
35 ~ChromeFrameDelegate() {}
36 };
37
38 // Template specialization
39 template <> struct RunnableMethodTraits<ChromeFrameDelegate> {
40 static void RetainCallee(ChromeFrameDelegate* obj) {
41 }
42
43 static void ReleaseCallee(ChromeFrameDelegate* obj) {
44 }
45 };
46
47 extern UINT kAutomationServerReady;
48 extern UINT kMessageFromChromeFrame;
49
50 class ChromeFrameDelegateImpl : public ChromeFrameDelegate {
51 public:
52 virtual WindowType GetWindow() { return NULL; }
53 virtual void GetBounds(RECT* bounds) {}
54 virtual std::string GetDocumentUrl() { return std::string(); }
55 virtual void OnAutomationServerReady() {}
56 virtual void OnAutomationServerLaunchFailed(
57 AutomationLaunchResult reason, const std::string& server_version) {}
58 virtual void OnLoadFailed(int error_code, const std::string& url) {}
59 virtual void OnMessageReceived(const IPC::Message& msg);
60 static bool IsTabMessage(const IPC::Message& message, int* tab_handle);
61
62 virtual bool IsValid() const {
63 return true;
64 }
65
66 protected:
67 // Protected methods to be overriden.
68 virtual void OnNavigationStateChanged(int tab_handle, int flags,
69 const IPC::NavigationInfo& nav_info) {}
70 virtual void OnUpdateTargetUrl(int tab_handle,
71 const std::wstring& new_target_url) {}
72 virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message) {}
73 virtual void OnTabbedOut(int tab_handle, bool reverse) {}
74 virtual void OnOpenURL(int tab_handle, const GURL& url,
75 int open_disposition) {}
76 virtual void OnDidNavigate(int tab_handle,
77 const IPC::NavigationInfo& navigation_info) {}
78 virtual void OnNavigationFailed(int tab_handle, int error_code,
79 const GURL& gurl) {}
80 virtual void OnLoad(int tab_handle, const GURL& url) {}
81 virtual void OnMessageFromChromeFrame(int tab_handle,
82 const std::string& message,
83 const std::string& origin,
84 const std::string& target) {}
85 virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle,
86 int x_pos, int y_pos, int align_flags) {}
87 virtual void OnRequestStart(int tab_handle, int request_id,
88 const IPC::AutomationURLRequest& request) {}
89 virtual void OnRequestRead(int tab_handle, int request_id,
90 int bytes_to_read) {}
91 virtual void OnRequestEnd(int tab_handle, int request_id,
92 const URLRequestStatus& status) {}
93 virtual void OnSetCookieAsync(int tab_handle, const GURL& url,
94 const std::string& cookie) {}
95 virtual void OnAttachExternalTab(int tab_handle, intptr_t cookie,
96 int disposition) {}
97 };
98
99 #endif // CHROME_FRAME_CHROME_FRAME_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_automation.cc ('k') | chrome_frame/chrome_frame_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698