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

Side by Side Diff: chrome/browser/extensions/extension_message_handler.h

Issue 8676032: Move RenderViewHostObserver to content/public/browser/ and put it into the content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add render_view_host.h to DEPS file Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "content/browser/renderer_host/render_view_host_observer.h" 11 #include "content/public/browser/render_view_host_observer.h"
12 12
13 // Filters and dispatches extension-related IPC messages that arrive from 13 // Filters and dispatches extension-related IPC messages that arrive from
14 // renderers. There is one of these objects for each RenderViewHost in Chrome. 14 // renderers. There is one of these objects for each RenderViewHost in Chrome.
15 // Contrast this with ExtensionTabHelper, which is only created for TabContents. 15 // Contrast this with ExtensionTabHelper, which is only created for TabContents.
16 // 16 //
17 // TODO(aa): Handling of content script messaging should be able to move to EFD 17 // TODO(aa): Handling of content script messaging should be able to move to EFD
18 // once there is an EFD for every RVHD where extension code can run. Then we 18 // once there is an EFD for every RVHD where extension code can run. Then we
19 // could eliminate this class. Right now, we don't end up with an EFD for tab 19 // could eliminate this class. Right now, we don't end up with an EFD for tab
20 // contents unless that tab contents is hosting chrome-extension:// URLs. That 20 // contents unless that tab contents is hosting chrome-extension:// URLs. That
21 // still leaves content scripts. See also: crbug.com/80307. 21 // still leaves content scripts. See also: crbug.com/80307.
22 class ExtensionMessageHandler : public RenderViewHostObserver { 22 class ExtensionMessageHandler : public content::RenderViewHostObserver {
23 public: 23 public:
24 // |sender| is guaranteed to outlive this object. 24 // |sender| is guaranteed to outlive this object.
25 explicit ExtensionMessageHandler(RenderViewHost* render_view_host); 25 explicit ExtensionMessageHandler(RenderViewHost* render_view_host);
26 virtual ~ExtensionMessageHandler(); 26 virtual ~ExtensionMessageHandler();
27 27
28 // RenderViewHostObserver overrides. 28 // RenderViewHostObserver overrides.
29 virtual void RenderViewHostInitialized() OVERRIDE; 29 virtual void RenderViewHostInitialized() OVERRIDE;
30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
31 31
32 private: 32 private:
33 // Message handlers. 33 // Message handlers.
34 void OnPostMessage(int port_id, const std::string& message); 34 void OnPostMessage(int port_id, const std::string& message);
35 35
36 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageHandler); 36 DISALLOW_COPY_AND_ASSIGN(ExtensionMessageHandler);
37 }; 37 };
38 38
39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ 39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698