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

Unified Diff: extensions/browser/renderer_startup_helper.cc

Issue 2241203003: Pass user session type to extension feature checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/renderer_startup_helper.cc
diff --git a/extensions/browser/renderer_startup_helper.cc b/extensions/browser/renderer_startup_helper.cc
index 452c816963ddd1b509e6b12ea30c540b9b7ce566..d3631f76820514a630fe8a05eceb316e1c7c0350 100644
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -11,6 +11,7 @@
#include "content/public/browser/render_process_host.h"
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_util.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/common/extension_messages.h"
@@ -70,6 +71,14 @@ void RendererStartupHelper::InitializeProcess(
// to all renderers, as the non-extension renderers may have content scripts.
process->Send(new ExtensionMsg_SetChannel(GetCurrentChannel()));
+ // Extensions need to know the session type for API restrictions. The session
+ // type is determined based on the user for which the current session is
+ // started.
+ // The value is sent to all renderers, as the non-extension renderers may have
+ // content scripts.
+ process->Send(new ExtensionMsg_SetUserSessionType(
+ extensions::util::GetCurrentSessionType()));
rkc 2016/08/17 23:07:24 This can be GetCurrentFeatureSessionType() instead
tbarzic 2016/08/18 01:05:33 Done.
+
// Platform apps need to know the system font.
// TODO(dbeam): this is not the system font in all cases.
process->Send(new ExtensionMsg_SetSystemFont(webui::GetFontFamily(),

Powered by Google App Engine
This is Rietveld 408576698