| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/renderer_startup_helper.h" | 5 #include "extensions/browser/renderer_startup_helper.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/common/extensions/features/feature_channel.h" | |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
| 11 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
| 12 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
| 13 #include "extensions/browser/extension_function_dispatcher.h" | 12 #include "extensions/browser/extension_function_dispatcher.h" |
| 14 #include "extensions/browser/extension_registry.h" | 13 #include "extensions/browser/extension_registry.h" |
| 15 #include "extensions/browser/extensions_browser_client.h" | 14 #include "extensions/browser/extensions_browser_client.h" |
| 16 #include "extensions/common/extension_messages.h" | 15 #include "extensions/common/extension_messages.h" |
| 17 #include "extensions/common/extension_set.h" | 16 #include "extensions/common/extension_set.h" |
| 18 #include "extensions/common/extensions_client.h" | 17 #include "extensions/common/extensions_client.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 36 const content::NotificationSource& source, | 35 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) { | 36 const content::NotificationDetails& details) { |
| 38 switch (type) { | 37 switch (type) { |
| 39 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { | 38 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { |
| 40 content::RenderProcessHost* process = | 39 content::RenderProcessHost* process = |
| 41 content::Source<content::RenderProcessHost>(source).ptr(); | 40 content::Source<content::RenderProcessHost>(source).ptr(); |
| 42 if (!ExtensionsBrowserClient::Get()->IsSameContext( | 41 if (!ExtensionsBrowserClient::Get()->IsSameContext( |
| 43 browser_context_, process->GetBrowserContext())) | 42 browser_context_, process->GetBrowserContext())) |
| 44 break; | 43 break; |
| 45 | 44 |
| 46 // Extensions need to know the channel for API restrictions. | |
| 47 process->Send(new ExtensionMsg_SetChannel( | |
| 48 extensions::GetCurrentChannel())); | |
| 49 | |
| 50 // Platform apps need to know the system font. | 45 // Platform apps need to know the system font. |
| 51 scoped_ptr<base::DictionaryValue> fonts(new base::DictionaryValue); | 46 scoped_ptr<base::DictionaryValue> fonts(new base::DictionaryValue); |
| 52 webui::SetFontAndTextDirection(fonts.get()); | 47 webui::SetFontAndTextDirection(fonts.get()); |
| 53 std::string font_family, font_size; | 48 std::string font_family, font_size; |
| 54 fonts->GetString("fontfamily", &font_family); | 49 fonts->GetString("fontfamily", &font_family); |
| 55 fonts->GetString("fontsize", &font_size); | 50 fonts->GetString("fontsize", &font_size); |
| 56 process->Send(new ExtensionMsg_SetSystemFont( | 51 process->Send(new ExtensionMsg_SetSystemFont( |
| 57 font_family, font_size)); | 52 font_family, font_size)); |
| 58 | 53 |
| 59 // Valid extension function names, used to setup bindings in renderer. | 54 // Valid extension function names, used to setup bindings in renderer. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 BrowserContext* context) const { | 112 BrowserContext* context) const { |
| 118 // Redirected in incognito. | 113 // Redirected in incognito. |
| 119 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); | 114 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); |
| 120 } | 115 } |
| 121 | 116 |
| 122 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const { | 117 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const { |
| 123 return true; | 118 return true; |
| 124 } | 119 } |
| 125 | 120 |
| 126 } // namespace extensions | 121 } // namespace extensions |
| OLD | NEW |