summaryrefslogtreecommitdiffstats
path: root/chrome_frame/cfproxy.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:15:34 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 22:15:34 +0000
commitf5494d49ab74e3d116540b14db3457558f54c88e (patch)
treebeb367c01c187652d02091a5067a69d5bc0fa064 /chrome_frame/cfproxy.h
parenta9f39a313b7ecc11d98727d869e15094481f3a65 (diff)
downloadchromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.zip
chromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.tar.gz
chromium_src-f5494d49ab74e3d116540b14db3457558f54c88e.tar.bz2
Clean up Automation and Chrome Frame IPC code.-only use routed messages when needed-use routing IDs to avoid manually unpacking messages-remove data structures from IPC namespace (that should only be used for IPC code, and param traits)Note that I temporarily commented out part of a test in external_tab_test.cc because I couldn't figure out how to get the updated gmock macros to compile.
Review URL: http://codereview.chromium.org/5998006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/cfproxy.h')
-rw-r--r--chrome_frame/cfproxy.h60
1 files changed, 14 insertions, 46 deletions
diff --git a/chrome_frame/cfproxy.h b/chrome_frame/cfproxy.h
index c3acf7a..ae404b2 100644
--- a/chrome_frame/cfproxy.h
+++ b/chrome_frame/cfproxy.h
@@ -15,6 +15,7 @@
#include "base/file_path.h"
#include "chrome/common/automation_constants.h"
#include "chrome/common/page_zoom.h"
+#include "ipc/ipc_channel.h"
enum FindInPageDirection { BACK = 0, FWD = 1 };
enum FindInPageCase { IGNORE_CASE = 0, CASE_SENSITIVE = 1 };
@@ -28,18 +29,15 @@ enum AutomationPageFontSize {
LARGEST_FONT = 36
};
-class URLRequestStatus;
-namespace IPC {
- struct ExternalTabSettings;
- struct NavigationInfo;
- struct AutomationURLRequest;
- struct AttachExternalTabParams;
- struct MiniContextMenuParams;
-};
-
-class GURL;
-class ChromeProxyFactory;
class ChromeProxyDelegate;
+class ChromeProxyFactory;
+class GURL;
+class URLRequestStatus;
+struct AttachExternalTabParams;
+struct AutomationURLRequest;
+struct ExternalTabSettings;
+struct MiniContextMenuParams;
+struct NavigationInfo;
struct ProxyParams;
// Some callers of synchronous messages wants a context to be passed back
@@ -89,7 +87,7 @@ class ChromeProxy {
// Tab management.
virtual void CreateTab(ChromeProxyDelegate* delegate,
- const IPC::ExternalTabSettings& settings) = 0;
+ const ExternalTabSettings& settings) = 0;
virtual void ConnectTab(ChromeProxyDelegate* delegate, HWND hwnd,
uint64 cookie) = 0;
virtual void BlockTab(uint64 cookie) = 0;
@@ -142,7 +140,7 @@ class ChromeProxy {
// instance of Chromium.
// Allow only one delegate per tab, i.e. delegate can handle only a single tab.
// Note: all of the methods are invoked always in a background IPC thread.
-class ChromeProxyDelegate {
+class ChromeProxyDelegate : public IPC::Channel::Listener {
public:
enum DisconnectReason {
CHROME_EXE_LAUNCH_FAILED,
@@ -150,6 +148,9 @@ class ChromeProxyDelegate {
CHANNEL_ERROR
};
+ // IPC::Channel::Listener.
+ void OnMessageReceived(const IPC::Message& message) = 0;
+
virtual void Connected(ChromeProxy* proxy) = 0;
virtual void Disconnected() = 0;
virtual void PeerLost(ChromeProxy* proxy, DisconnectReason reason) = 0;
@@ -169,39 +170,6 @@ class ChromeProxyDelegate {
virtual void Completed_GetEnabledExtensions(bool success,
const std::vector<FilePath>* extensions) = 0;
- // Network requests from Chrome.
- virtual void Network_Start(int request_id,
- const IPC::AutomationURLRequest& request_info) = 0;
- virtual void Network_Read(int request_id, int bytes_to_read) = 0;
- virtual void Network_End(int request_id, const URLRequestStatus& status) = 0;
- virtual void Network_DownloadInHost(int request_id) = 0;
- virtual void GetCookies(const GURL& url, int cookie_id) = 0;
- virtual void SetCookie(const GURL& url, const std::string& cookie) = 0;
-
- // Navigation progress notifications.
- virtual void NavigationStateChanged(int flags,
- const IPC::NavigationInfo& nav_info) = 0;
- virtual void UpdateTargetUrl(const std::wstring& url) = 0;
- virtual void NavigationFailed(int error_code, const GURL& gurl) = 0;
- virtual void DidNavigate(const IPC::NavigationInfo& navigation_info) = 0;
- virtual void TabLoaded(const GURL& url) = 0;
-
- // Navigation and messaging.
- virtual void OpenURL(const GURL& url_to_open, const GURL& referrer,
- int open_disposition) = 0;
- virtual void GoToHistoryOffset(int offset) = 0;
- virtual void MessageToHost(const std::string& message,
- const std::string& origin,
- const std::string& target) = 0;
- // Misc. UI.
- virtual void HandleAccelerator(const MSG& accel_message) = 0;
- virtual void HandleContextMenu(HANDLE menu_handle, int align_flags,
- const IPC::MiniContextMenuParams& params) = 0;
- virtual void TabbedOut(bool reverse) = 0;
-
- // Tab related.
- virtual void TabClosed() = 0;
- virtual void AttachTab(const IPC::AttachExternalTabParams& attach_params) = 0;
protected:
~ChromeProxyDelegate() {}
};