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

Side by Side Diff: chrome/renderer/extensions/extension_helper.cc

Issue 6735004: Move extension messages to their own file and add a RenderViewObserver to start moving the extens... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/renderer/extensions/extension_helper.h"
6
7 #include "chrome/common/extensions/extension_messages.h"
8 #include "chrome/renderer/extensions/extension_process_bindings.h"
9 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
10
11 ExtensionHelper::ExtensionHelper(RenderView* render_view)
12 : RenderViewObserver(render_view) {
13 }
14
15 ExtensionHelper::~ExtensionHelper() {
16 }
17
18 bool ExtensionHelper::OnMessageReceived(const IPC::Message& message) {
19 bool handled = true;
20 IPC_BEGIN_MESSAGE_MAP(ExtensionHelper, message)
21 IPC_MESSAGE_HANDLER(ExtensionMsg_Response, OnExtensionResponse)
22 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnExtensionMessageInvoke)
23 IPC_MESSAGE_UNHANDLED(handled = false)
24 IPC_END_MESSAGE_MAP()
25 return handled;
26 }
27
28 void ExtensionHelper::OnExtensionResponse(int request_id,
29 bool success,
30 const std::string& response,
31 const std::string& error) {
32 ExtensionProcessBindings::HandleResponse(
33 request_id, success, response, error);
34 }
35
36 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id,
37 const std::string& function_name,
38 const ListValue& args,
39 const GURL& event_url) {
40 RendererExtensionBindings::Invoke(
41 extension_id, function_name, args, render_view(), event_url);
42 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_helper.h ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698