Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / messaging / extension_message_port.h
blob8445bdac1494ef015312f82599a518aae5fde2f6
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
8 #include "chrome/browser/extensions/api/messaging/message_service.h"
10 class GURL;
12 namespace content {
13 class RenderProcessHost;
14 } // namespace content
16 namespace extensions {
18 // A port that manages communication with an extension.
19 class ExtensionMessagePort : public MessageService::MessagePort {
20 public:
21 ExtensionMessagePort(content::RenderProcessHost* process,
22 int routing_id,
23 const std::string& extension_id);
24 void DispatchOnConnect(int dest_port_id,
25 const std::string& channel_name,
26 scoped_ptr<base::DictionaryValue> source_tab,
27 int source_frame_id,
28 int target_frame_id,
29 int guest_process_id,
30 int guest_render_frame_routing_id,
31 const std::string& source_extension_id,
32 const std::string& target_extension_id,
33 const GURL& source_url,
34 const std::string& tls_channel_id) override;
35 void DispatchOnDisconnect(int source_port_id,
36 const std::string& error_message) override;
37 void DispatchOnMessage(const Message& message, int target_port_id) override;
38 void IncrementLazyKeepaliveCount() override;
39 void DecrementLazyKeepaliveCount() override;
40 content::RenderProcessHost* GetRenderProcessHost() override;
42 private:
43 content::RenderProcessHost* process_;
44 int routing_id_;
45 std::string extension_id_;
46 void* background_host_ptr_; // used in IncrementLazyKeepaliveCount
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_