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

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

Issue 1312653003: Fix for WebView accessible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments by kalman@. Created 5 years, 3 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
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"
11 #include "content/public/browser/render_process_host.h" 11 #include "content/public/browser/render_process_host.h"
12 #include "extensions/browser/extension_function_dispatcher.h" 12 #include "extensions/browser/extension_function_dispatcher.h"
13 #include "extensions/browser/extension_registry.h" 13 #include "extensions/browser/extension_registry.h"
14 #include "extensions/browser/extensions_browser_client.h" 14 #include "extensions/browser/extensions_browser_client.h"
15 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
15 #include "extensions/common/extension_messages.h" 16 #include "extensions/common/extension_messages.h"
16 #include "extensions/common/extension_set.h" 17 #include "extensions/common/extension_set.h"
17 #include "extensions/common/extensions_client.h" 18 #include "extensions/common/extensions_client.h"
18 #include "ui/base/webui/web_ui_util.h" 19 #include "ui/base/webui/web_ui_util.h"
19 20
20 using content::BrowserContext; 21 using content::BrowserContext;
21 22
22 namespace extensions { 23 namespace extensions {
23 24
24 RendererStartupHelper::RendererStartupHelper(BrowserContext* browser_context) 25 RendererStartupHelper::RendererStartupHelper(BrowserContext* browser_context)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (!ext->is_theme()) { 66 if (!ext->is_theme()) {
66 // TODO(kalman): Only include tab specific permissions for extension 67 // TODO(kalman): Only include tab specific permissions for extension
67 // processes, no other process needs it, so it's mildly wasteful. 68 // processes, no other process needs it, so it's mildly wasteful.
68 // I am not sure this is possible to know this here, at such a low 69 // I am not sure this is possible to know this here, at such a low
69 // level of the stack. Perhaps site isolation can help. 70 // level of the stack. Perhaps site isolation can help.
70 bool include_tab_permissions = true; 71 bool include_tab_permissions = true;
71 loaded_extensions.push_back( 72 loaded_extensions.push_back(
72 ExtensionMsg_Loaded_Params(ext.get(), include_tab_permissions)); 73 ExtensionMsg_Loaded_Params(ext.get(), include_tab_permissions));
73 } 74 }
74 } 75 }
76 std::string webview_partition_id = WebViewGuest::GetPartitionID(process);
77 if (!webview_partition_id.empty()) {
78 process->Send(new ExtensionMsg_SetWebViewPartitionID(
79 WebViewGuest::GetPartitionID(process)));
80 }
not at google - send to devlin 2015/08/31 21:52:51 Take care where you put new code. In the original
paulmeyer 2015/09/02 13:43:57 Done.
75 process->Send(new ExtensionMsg_Loaded(loaded_extensions)); 81 process->Send(new ExtensionMsg_Loaded(loaded_extensions));
76 } 82 }
77 83
78 ////////////////////////////////////////////////////////////////////////////// 84 //////////////////////////////////////////////////////////////////////////////
79 85
80 // static 86 // static
81 RendererStartupHelper* RendererStartupHelperFactory::GetForBrowserContext( 87 RendererStartupHelper* RendererStartupHelperFactory::GetForBrowserContext(
82 BrowserContext* context) { 88 BrowserContext* context) {
83 return static_cast<RendererStartupHelper*>( 89 return static_cast<RendererStartupHelper*>(
84 GetInstance()->GetServiceForBrowserContext(context, true)); 90 GetInstance()->GetServiceForBrowserContext(context, true));
(...skipping 22 matching lines...) Expand all
107 BrowserContext* context) const { 113 BrowserContext* context) const {
108 // Redirected in incognito. 114 // Redirected in incognito.
109 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 115 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
110 } 116 }
111 117
112 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const { 118 bool RendererStartupHelperFactory::ServiceIsCreatedWithBrowserContext() const {
113 return true; 119 return true;
114 } 120 }
115 121
116 } // namespace extensions 122 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698