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

Side by Side Diff: chrome_frame/external_tab.h

Issue 5998006: Clean up Automation and Chrome Frame IPC code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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_plugin.h ('k') | chrome_frame/external_tab.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_FRAME_EXTERNAL_TAB_H_ 5 #ifndef CHROME_FRAME_EXTERNAL_TAB_H_
6 #define CHROME_FRAME_EXTERNAL_TAB_H_ 6 #define CHROME_FRAME_EXTERNAL_TAB_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 #include <atlbase.h> 10 #include <atlbase.h>
(...skipping 18 matching lines...) Expand all
29 29
30 namespace IPC { 30 namespace IPC {
31 struct NavigationInfo; 31 struct NavigationInfo;
32 struct MiniContextMenuParams; 32 struct MiniContextMenuParams;
33 } 33 }
34 34
35 // This is the delegate/callback interface that has to be implemented 35 // This is the delegate/callback interface that has to be implemented
36 // by the customers of ExternalTabProxy class. 36 // by the customers of ExternalTabProxy class.
37 class UIDelegate { 37 class UIDelegate {
38 public: 38 public:
39 virtual void OnNavigationStateChanged(int flags, 39 virtual void OnNavigationStateChanged(
40 const IPC::NavigationInfo& nav_info) = 0; 40 int flags, const NavigationInfo& nav_info) = 0;
41 virtual void OnUpdateTargetUrl(const std::wstring& new_target_url) = 0; 41 virtual void OnUpdateTargetUrl(const std::wstring& new_target_url) = 0;
42 virtual void OnExtensionInstalled(const FilePath& path, void* user_data, 42 virtual void OnExtensionInstalled(const FilePath& path, void* user_data,
43 AutomationMsg_ExtensionResponseValues response) = 0; 43 AutomationMsg_ExtensionResponseValues response) = 0;
44 virtual void OnLoad(const GURL& url) = 0; 44 virtual void OnLoad(const GURL& url) = 0;
45 virtual void OnMessageFromChromeFrame(const std::string& message, 45 virtual void OnMessageFromChromeFrame(
46 const std::string& origin, const std::string& target) = 0; 46 const std::string& message, const std::string& origin,
47 virtual void OnHandleContextMenu(HANDLE menu_handle, int align_flags, 47 const std::string& target) = 0;
48 const IPC::MiniContextMenuParams& params) = 0; 48 virtual void OnHandleContextMenu(
49 HANDLE menu_handle, int align_flags,
50 const MiniContextMenuParams& params) = 0;
49 virtual void OnHandleAccelerator(const MSG& accel_message) = 0; 51 virtual void OnHandleAccelerator(const MSG& accel_message) = 0;
50 virtual void OnTabbedOut(bool reverse) = 0; 52 virtual void OnTabbedOut(bool reverse) = 0;
51 virtual void OnGoToHistoryOffset(int offset) = 0; 53 virtual void OnGoToHistoryOffset(int offset) = 0;
52 virtual void OnOpenURL(const GURL& url_to_open, const GURL& referrer, 54 virtual void OnOpenURL(
53 int open_disposition) = 0; 55 const GURL& url_to_open, const GURL& referrer, int open_disposition) = 0;
54 protected: 56 protected:
55 ~UIDelegate() {} 57 ~UIDelegate() {}
56 }; 58 };
57 59
58 struct CreateTabParams { 60 struct CreateTabParams {
59 struct ProxyParams proxy_params; 61 struct ProxyParams proxy_params;
60 bool is_incognito; 62 bool is_incognito;
61 bool is_widget_mode; 63 bool is_widget_mode;
62 GURL url; 64 GURL url;
63 GURL referrer; 65 GURL referrer;
(...skipping 19 matching lines...) Expand all
83 public ChromeProxyDelegate { 85 public ChromeProxyDelegate {
84 public: 86 public:
85 ExternalTabProxy(); 87 ExternalTabProxy();
86 ~ExternalTabProxy(); 88 ~ExternalTabProxy();
87 89
88 #ifdef UNIT_TEST 90 #ifdef UNIT_TEST
89 void set_proxy_factory(ChromeProxyFactory* factory) { 91 void set_proxy_factory(ChromeProxyFactory* factory) {
90 proxy_factory_ = factory; 92 proxy_factory_ = factory;
91 } 93 }
92 #endif 94 #endif
95
96 // IPC::Channel::Listener implementation.
97 void OnMessageReceived(const IPC::Message& message);
98
93 // 99 //
94 virtual void CreateTab(const CreateTabParams& create_params, 100 virtual void CreateTab(const CreateTabParams& create_params,
95 UIDelegate* delegate); 101 UIDelegate* delegate);
96 virtual void Navigate(const std::string& url, const std::string& referrer, 102 virtual void Navigate(const std::string& url, const std::string& referrer,
97 NavigationConstraints* navigation_constraints); 103 NavigationConstraints* navigation_constraints);
98 virtual void NavigateToIndex(int index); 104 virtual void NavigateToIndex(int index);
99 virtual void ForwardMessageFromExternalHost(const std::string& message, 105 virtual void ForwardMessageFromExternalHost(const std::string& message,
100 const std::string& origin, const std::string& target); 106 const std::string& origin, const std::string& target);
101 virtual void ChromeFrameHostMoved(); 107 virtual void ChromeFrameHostMoved();
102 108
(...skipping 16 matching lines...) Expand all
119 125
120 ////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////
121 // ChromeProxyDelegate implementation 127 // ChromeProxyDelegate implementation
122 virtual int tab_handle() { 128 virtual int tab_handle() {
123 return tab_; 129 return tab_;
124 } 130 }
125 virtual void Connected(ChromeProxy* proxy); 131 virtual void Connected(ChromeProxy* proxy);
126 virtual void PeerLost(ChromeProxy* proxy, DisconnectReason reason); 132 virtual void PeerLost(ChromeProxy* proxy, DisconnectReason reason);
127 virtual void Disconnected(); 133 virtual void Disconnected();
128 134
129
130 // Sync message responses. 135 // Sync message responses.
131 virtual void Completed_CreateTab(bool success, HWND chrome_wnd, 136 virtual void Completed_CreateTab(bool success, HWND chrome_wnd,
132 HWND tab_window, int tab_handle, int session_id); 137 HWND tab_window, int tab_handle, int session_id);
133 virtual void Completed_ConnectToTab(bool success, HWND chrome_window, 138 virtual void Completed_ConnectToTab(bool success, HWND chrome_window,
134 HWND tab_window, int tab_handle, int session_id); 139 HWND tab_window, int tab_handle, int session_id);
135 virtual void Completed_Navigate(bool success, 140 virtual void Completed_Navigate(bool success,
136 enum AutomationMsg_NavigationResponseValues res); 141 enum AutomationMsg_NavigationResponseValues res);
137 virtual void Completed_InstallExtension(bool success, 142 virtual void Completed_InstallExtension(bool success,
138 enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx); 143 enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx);
139 virtual void Completed_LoadExpandedExtension(bool success, 144 virtual void Completed_LoadExpandedExtension(bool success,
140 enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx); 145 enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx);
141 virtual void Completed_GetEnabledExtensions(bool success, 146 virtual void Completed_GetEnabledExtensions(bool success,
142 const std::vector<FilePath>* extensions); 147 const std::vector<FilePath>* extensions);
143 148
144 // Network requests from Chrome. 149 // Network requests from Chrome.
145 virtual void Network_Start(int request_id, 150 virtual void OnNetwork_Start(
146 const IPC::AutomationURLRequest& request_info); 151 int request_id, const AutomationURLRequest& request_info);
147 virtual void Network_Read(int request_id, int bytes_to_read); 152 virtual void OnNetwork_Read(int request_id, int bytes_to_read);
148 virtual void Network_End(int request_id, const URLRequestStatus& s); 153 virtual void OnNetwork_End(int request_id, const URLRequestStatus& s);
149 virtual void Network_DownloadInHost(int request_id); 154 virtual void OnNetwork_DownloadInHost(int request_id);
150 virtual void GetCookies(const GURL& url, int cookie_id); 155 virtual void OnGetCookies(const GURL& url, int cookie_id);
151 virtual void SetCookie(const GURL& url, const std::string& cookie); 156 virtual void OnSetCookie(const GURL& url, const std::string& cookie);
152 157
153 // Navigation progress notifications. 158 // Navigation progress notifications.
154 virtual void NavigationStateChanged(int flags, 159 virtual void OnNavigationStateChanged(
155 const IPC::NavigationInfo& nav_info); 160 int flags, const NavigationInfo& nav_info);
156 virtual void UpdateTargetUrl(const std::wstring& url); 161 virtual void OnUpdateTargetUrl(const std::wstring& url);
157 virtual void NavigationFailed(int error_code, const GURL& gurl); 162 virtual void OnNavigationFailed(int error_code, const GURL& gurl);
158 virtual void DidNavigate(const IPC::NavigationInfo& navigation_info); 163 virtual void OnDidNavigate(const NavigationInfo& navigation_info);
159 virtual void TabLoaded(const GURL& url); 164 virtual void OnTabLoaded(const GURL& url);
160 165
161 virtual void OpenURL(const GURL& url_to_open, const GURL& referrer, 166 virtual void OnOpenURL(const GURL& url_to_open, const GURL& referrer,
162 int open_disposition); 167 int open_disposition);
163 virtual void GoToHistoryOffset(int offset); 168 virtual void OnGoToHistoryOffset(int offset);
164 virtual void MessageToHost(const std::string& message, 169 virtual void OnMessageToHost(
165 const std::string& origin, const std::string& target); 170 const std::string& message, const std::string& origin,
171 const std::string& target);
166 172
167 // Misc. UI. 173 // Misc. UI.
168 virtual void HandleAccelerator(const MSG& accel_message); 174 virtual void OnHandleAccelerator(const MSG& accel_message);
169 virtual void HandleContextMenu(HANDLE menu_handle, int align_flags, 175 virtual void OnHandleContextMenu(HANDLE menu_handle, int align_flags,
170 const IPC::MiniContextMenuParams& params); 176 const MiniContextMenuParams& params);
171 virtual void TabbedOut(bool reverse); 177 virtual void OnTabbedOut(bool reverse);
172 178
173 // Other 179 // Other
174 virtual void TabClosed(); 180 virtual void OnTabClosed();
175 virtual void AttachTab(const IPC::AttachExternalTabParams& attach_params); 181 virtual void OnAttachTab(const AttachExternalTabParams& attach_params);
176 182
177 // end of ChromeProxyDelegate methods 183 // end of ChromeProxyDelegate methods
178 ////////////////////////////////////////////////////////////////////////// 184 //////////////////////////////////////////////////////////////////////////
179 void Init(); 185 void Init();
180 void Destroy(); 186 void Destroy();
181 187
182 // The UiXXXX are the ChromeProxyDelegate methods but on UI thread. 188 // The UiXXXX are the ChromeProxyDelegate methods but on UI thread.
183 void UiConnected(ChromeProxy* proxy); 189 void UiConnected(ChromeProxy* proxy);
184 void UiPeerLost(ChromeProxy* proxy, DisconnectReason reason); 190 void UiPeerLost(ChromeProxy* proxy, DisconnectReason reason);
185 void UiCompleted_CreateTab(bool success, HWND chrome_window, 191 void UiCompleted_CreateTab(bool success, HWND chrome_window,
(...skipping 30 matching lines...) Expand all
216 GURL url; 222 GURL url;
217 GURL referrer; 223 GURL referrer;
218 void Set(const GURL& gurl, const GURL& ref) { 224 void Set(const GURL& gurl, const GURL& ref) {
219 url = gurl; 225 url = gurl;
220 referrer = ref; 226 referrer = ref;
221 } 227 }
222 } pending_navigation_; 228 } pending_navigation_;
223 }; 229 };
224 230
225 #endif // CHROME_FRAME_EXTERNAL_TAB_H_ 231 #endif // CHROME_FRAME_EXTERNAL_TAB_H_
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_plugin.h ('k') | chrome_frame/external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698