OLD | NEW |
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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/view_type_utils.h" | 10 #include "chrome/browser/view_type_utils.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 WebContents::FromRenderViewHost(render_view_host()); | 38 WebContents::FromRenderViewHost(render_view_host()); |
39 Send(new ExtensionMsg_NotifyRenderViewType( | 39 Send(new ExtensionMsg_NotifyRenderViewType( |
40 routing_id(), chrome::GetViewType(web_contents))); | 40 routing_id(), chrome::GetViewType(web_contents))); |
41 } | 41 } |
42 | 42 |
43 void ExtensionMessageHandler::OnPostMessage(int port_id, | 43 void ExtensionMessageHandler::OnPostMessage(int port_id, |
44 const std::string& message) { | 44 const std::string& message) { |
45 Profile* profile = Profile::FromBrowserContext( | 45 Profile* profile = Profile::FromBrowserContext( |
46 render_view_host()->GetProcess()->GetBrowserContext()); | 46 render_view_host()->GetProcess()->GetBrowserContext()); |
47 ExtensionMessageService* message_service = | 47 ExtensionMessageService* message_service = |
48 ExtensionSystem::Get(profile)->message_service(); | 48 extensions::ExtensionSystem::Get(profile)->message_service(); |
49 if (message_service) { | 49 if (message_service) { |
50 message_service->PostMessageFromRenderer(port_id, message); | 50 message_service->PostMessageFromRenderer(port_id, message); |
51 } | 51 } |
52 } | 52 } |
OLD | NEW |