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

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

Issue 9977021: Add ExtensionSytem::Get(Profile*) as a wrapper around (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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) 2012 The Chromium Authors. All rights reserved. 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 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_message_handler.h" 5 #include "chrome/browser/extensions/extension_message_handler.h"
6 6
7 #include "chrome/browser/extensions/extension_message_service.h" 7 #include "chrome/browser/extensions/extension_message_service.h"
8 #include "chrome/browser/extensions/extension_system.h" 8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/browser/extensions/extension_system_factory.h"
10 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
12 #include "content/public/browser/render_process_host.h" 11 #include "content/public/browser/render_process_host.h"
13 #include "content/public/browser/render_view_host.h" 12 #include "content/public/browser/render_view_host.h"
14 #include "content/public/browser/render_view_host_delegate.h" 13 #include "content/public/browser/render_view_host_delegate.h"
15 14
16 ExtensionMessageHandler::ExtensionMessageHandler( 15 ExtensionMessageHandler::ExtensionMessageHandler(
17 content::RenderViewHost* render_view_host) 16 content::RenderViewHost* render_view_host)
18 : content::RenderViewHostObserver(render_view_host) { 17 : content::RenderViewHostObserver(render_view_host) {
19 } 18 }
(...skipping 14 matching lines...) Expand all
34 void ExtensionMessageHandler::RenderViewHostInitialized() { 33 void ExtensionMessageHandler::RenderViewHostInitialized() {
35 Send(new ExtensionMsg_NotifyRenderViewType( 34 Send(new ExtensionMsg_NotifyRenderViewType(
36 routing_id(), render_view_host()->GetDelegate()->GetRenderViewType())); 35 routing_id(), render_view_host()->GetDelegate()->GetRenderViewType()));
37 } 36 }
38 37
39 void ExtensionMessageHandler::OnPostMessage(int port_id, 38 void ExtensionMessageHandler::OnPostMessage(int port_id,
40 const std::string& message) { 39 const std::string& message) {
41 Profile* profile = Profile::FromBrowserContext( 40 Profile* profile = Profile::FromBrowserContext(
42 render_view_host()->GetProcess()->GetBrowserContext()); 41 render_view_host()->GetProcess()->GetBrowserContext());
43 ExtensionMessageService* message_service = 42 ExtensionMessageService* message_service =
44 ExtensionSystemFactory::GetForProfile(profile)->message_service(); 43 ExtensionSystem::Get(profile)->message_service();
45 if (message_service) { 44 if (message_service) {
46 message_service->PostMessageFromRenderer(port_id, message); 45 message_service->PostMessageFromRenderer(port_id, message);
47 } 46 }
48 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698