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

Side by Side Diff: chrome/browser/extensions/extension_event_router.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
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 #include "chrome/browser/extensions/extension_event_router.h" 5 #include "chrome/browser/extensions/extension_event_router.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/extension_devtools_manager.h" 8 #include "chrome/browser/extensions/extension_devtools_manager.h"
9 #include "chrome/browser/extensions/extension_processes_api.h" 9 #include "chrome/browser/extensions/extension_processes_api.h"
10 #include "chrome/browser/extensions/extension_processes_api_constants.h" 10 #include "chrome/browser/extensions/extension_processes_api_constants.h"
11 #include "chrome/browser/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/extension_tabs_module.h" 12 #include "chrome/browser/extensions/extension_tabs_module.h"
13 #include "chrome/browser/extensions/extension_webrequest_api.h" 13 #include "chrome/browser/extensions/extension_webrequest_api.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/common/extensions/extension.h" 15 #include "chrome/common/extensions/extension.h"
16 #include "chrome/common/render_messages.h" 16 #include "chrome/common/extensions/extension_messages.h"
17 #include "content/browser/child_process_security_policy.h" 17 #include "content/browser/child_process_security_policy.h"
18 #include "content/browser/renderer_host/render_process_host.h" 18 #include "content/browser/renderer_host/render_process_host.h"
19 #include "content/common/notification_service.h" 19 #include "content/common/notification_service.h"
20 20
21 namespace { 21 namespace {
22 22
23 const char kDispatchEvent[] = "Event.dispatchJSON"; 23 const char kDispatchEvent[] = "Event.dispatchJSON";
24 24
25 static void DispatchEvent(RenderProcessHost* renderer, 25 static void DispatchEvent(RenderProcessHost* renderer,
26 const std::string& extension_id, 26 const std::string& extension_id,
27 const std::string& event_name, 27 const std::string& event_name,
28 const std::string& event_args, 28 const std::string& event_args,
29 const GURL& event_url) { 29 const GURL& event_url) {
30 ListValue args; 30 ListValue args;
31 args.Set(0, Value::CreateStringValue(event_name)); 31 args.Set(0, Value::CreateStringValue(event_name));
32 args.Set(1, Value::CreateStringValue(event_args)); 32 args.Set(1, Value::CreateStringValue(event_args));
33 renderer->Send(new ViewMsg_ExtensionMessageInvoke(MSG_ROUTING_CONTROL, 33 renderer->Send(new ExtensionMsg_MessageInvoke(MSG_ROUTING_CONTROL,
34 extension_id, kDispatchEvent, args, event_url)); 34 extension_id, kDispatchEvent, args, event_url));
35 } 35 }
36 36
37 static void NotifyEventListenerRemovedOnIOThread( 37 static void NotifyEventListenerRemovedOnIOThread(
38 ProfileId profile_id, 38 ProfileId profile_id,
39 const std::string& extension_id, 39 const std::string& extension_id,
40 const std::string& sub_event_name) { 40 const std::string& sub_event_name) {
41 ExtensionWebRequestEventRouter::GetInstance()->RemoveEventListener( 41 ExtensionWebRequestEventRouter::GetInstance()->RemoveEventListener(
42 profile_id, extension_id, sub_event_name); 42 profile_id, extension_id, sub_event_name);
43 } 43 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 } 235 }
236 } 236 }
237 break; 237 break;
238 } 238 }
239 default: 239 default:
240 NOTREACHED(); 240 NOTREACHED();
241 return; 241 return;
242 } 242 }
243 } 243 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/extension_ports_remote_service.cc ('k') | chrome/browser/extensions/extension_function_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698