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

Side by Side Diff: extensions/browser/renderer_startup_helper.cc

Issue 747923004: webui: minimize webui flicker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: creis@ + davidben@ review Created 6 years 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
« no previous file with comments | « content/browser/webui/shared_resources_data_source.cc ('k') | ui/base/webui/web_ui_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
(...skipping 25 matching lines...) Expand all
36 const content::NotificationDetails& details) { 36 const content::NotificationDetails& details) {
37 switch (type) { 37 switch (type) {
38 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { 38 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: {
39 content::RenderProcessHost* process = 39 content::RenderProcessHost* process =
40 content::Source<content::RenderProcessHost>(source).ptr(); 40 content::Source<content::RenderProcessHost>(source).ptr();
41 if (!ExtensionsBrowserClient::Get()->IsSameContext( 41 if (!ExtensionsBrowserClient::Get()->IsSameContext(
42 browser_context_, process->GetBrowserContext())) 42 browser_context_, process->GetBrowserContext()))
43 break; 43 break;
44 44
45 // Platform apps need to know the system font. 45 // Platform apps need to know the system font.
46 scoped_ptr<base::DictionaryValue> fonts(new base::DictionaryValue); 46 // TODO(dbeam): this is not the system font in all cases.
47 webui::SetFontAndTextDirection(fonts.get()); 47 process->Send(new ExtensionMsg_SetSystemFont(webui::GetFontFamily(),
48 std::string font_family, font_size; 48 webui::GetFontSize()));
49 fonts->GetString("fontfamily", &font_family);
50 fonts->GetString("fontsize", &font_size);
51 process->Send(new ExtensionMsg_SetSystemFont(
52 font_family, font_size));
53 49
54 // Valid extension function names, used to setup bindings in renderer. 50 // Valid extension function names, used to setup bindings in renderer.
55 std::vector<std::string> function_names; 51 std::vector<std::string> function_names;
56 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); 52 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names);
57 process->Send(new ExtensionMsg_SetFunctionNames(function_names)); 53 process->Send(new ExtensionMsg_SetFunctionNames(function_names));
58 54
59 // Scripting whitelist. This is modified by tests and must be communicated 55 // Scripting whitelist. This is modified by tests and must be communicated
60 // to renderers. 56 // to renderers.
61 process->Send(new ExtensionMsg_SetScriptingWhitelist( 57 process->Send(new ExtensionMsg_SetScriptingWhitelist(
62 extensions::ExtensionsClient::Get()->GetScriptingWhitelist())); 58 extensions::ExtensionsClient::Get()->GetScriptingWhitelist()));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 BrowserContext* context) const { 108 BrowserContext* context) const {
113 // Redirected in incognito. 109 // Redirected in incognito.
114 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 110 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
115 } 111 }
116 112
117 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const { 113 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const {
118 return true; 114 return true;
119 } 115 }
120 116
121 } // namespace extensions 117 } // namespace extensions
OLDNEW
« no previous file with comments | « content/browser/webui/shared_resources_data_source.cc ('k') | ui/base/webui/web_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698