diff options
author | Kristian Monsen <kristianm@google.com> | 2011-06-28 21:49:31 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-07-08 17:55:00 +0100 |
commit | ddb351dbec246cf1fab5ec20d2d5520909041de1 (patch) | |
tree | 158e3fb57bdcac07c7f1e767fde3c70687c9fbb1 /chrome/browser/automation/extension_port_container.h | |
parent | 6b92e04f5f151c896e3088e86f70db7081009308 (diff) | |
download | external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.zip external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.gz external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.bz2 |
Merge Chromium at r12.0.742.93: Initial merge by git
Change-Id: Ic5ee2fec31358bbee305f7e915442377bfa6cda6
Diffstat (limited to 'chrome/browser/automation/extension_port_container.h')
-rw-r--r-- | chrome/browser/automation/extension_port_container.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/chrome/browser/automation/extension_port_container.h b/chrome/browser/automation/extension_port_container.h deleted file mode 100644 index d52e9a8..0000000 --- a/chrome/browser/automation/extension_port_container.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_AUTOMATION_EXTENSION_PORT_CONTAINER_H_ -#define CHROME_BROWSER_AUTOMATION_EXTENSION_PORT_CONTAINER_H_ -#pragma once - -#include <string> - -#include "base/basictypes.h" -#include "base/ref_counted.h" -#include "ipc/ipc_message.h" - -class AutomationProvider; -class ExtensionMessageService; -class GURL; -class ListValue; -class RenderViewHost; - -// This class represents an external port to an extension, opened -// through the automation interface. -class ExtensionPortContainer : public IPC::Message::Sender { - public: - - // Intercepts and processes a message posted through the automation interface. - // Returns true if the message was intercepted. - static bool InterceptMessageFromExternalHost(const std::string& message, - const std::string& origin, - const std::string& target, - AutomationProvider* automation, - RenderViewHost *view_host, - int tab_handle); - - ExtensionPortContainer(AutomationProvider* automation, int tab_handle); - ~ExtensionPortContainer(); - - int port_id() const { return port_id_; } - void set_port_id(int port_id) { port_id_ = port_id; } - - // IPC implementation. - virtual bool Send(IPC::Message* msg); - - private: - // Posts a message to the external host. - bool PostMessageToExternalPort(const std::string& message); - // Posts a request response message to the external host. - bool PostResponseToExternalPort(const std::string& message); - - // Forwards a message from the external port. - void PostMessageFromExternalPort(const std::string& message); - - // Attempts to connect this instance to the extension id, sends - // a response to the connecting party. - // Returns true if the connection was successful. - bool Connect(const std::string &extension_id, - int process_id, - int routing_id, - int connection_id, - const std::string& channel_name, - const std::string& tab_json); - - // Sends a connect response to the external port. - void SendConnectionResponse(int connection_id, int port_id); - - void OnExtensionMessageInvoke(const std::string& extension_id, - const std::string& function_name, - const ListValue& args, - const GURL& event_url); - void OnExtensionHandleMessage(const std::string& message, int source_port_id); - void OnExtensionPortDisconnected(int source_port_id); - - // Our automation provider. - AutomationProvider* automation_; - - // The extension message service. - scoped_refptr<ExtensionMessageService> service_; - - // Our assigned port id. - int port_id_; - // Handle to our associated tab. - int tab_handle_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionPortContainer); -}; - -#endif // CHROME_BROWSER_AUTOMATION_EXTENSION_PORT_CONTAINER_H_ |