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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 2241203003: Pass user session type to extension feature checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass user session type to extension renderer Created 4 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
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | 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/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 bool Dispatcher::OnControlMessageReceived(const IPC::Message& message) { 931 bool Dispatcher::OnControlMessageReceived(const IPC::Message& message) {
932 bool handled = true; 932 bool handled = true;
933 IPC_BEGIN_MESSAGE_MAP(Dispatcher, message) 933 IPC_BEGIN_MESSAGE_MAP(Dispatcher, message)
934 IPC_MESSAGE_HANDLER(ExtensionMsg_ActivateExtension, OnActivateExtension) 934 IPC_MESSAGE_HANDLER(ExtensionMsg_ActivateExtension, OnActivateExtension)
935 IPC_MESSAGE_HANDLER(ExtensionMsg_CancelSuspend, OnCancelSuspend) 935 IPC_MESSAGE_HANDLER(ExtensionMsg_CancelSuspend, OnCancelSuspend)
936 IPC_MESSAGE_HANDLER(ExtensionMsg_DeliverMessage, OnDeliverMessage) 936 IPC_MESSAGE_HANDLER(ExtensionMsg_DeliverMessage, OnDeliverMessage)
937 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnConnect, OnDispatchOnConnect) 937 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnConnect, OnDispatchOnConnect)
938 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect) 938 IPC_MESSAGE_HANDLER(ExtensionMsg_DispatchOnDisconnect, OnDispatchOnDisconnect)
939 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded) 939 IPC_MESSAGE_HANDLER(ExtensionMsg_Loaded, OnLoaded)
940 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke) 940 IPC_MESSAGE_HANDLER(ExtensionMsg_MessageInvoke, OnMessageInvoke)
941 IPC_MESSAGE_HANDLER(ExtensionMsg_SetChannel, OnSetChannel) 941 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSessionInfo, OnSetSessionInfo)
942 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist, 942 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist,
943 OnSetScriptingWhitelist) 943 OnSetScriptingWhitelist)
944 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont) 944 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont)
945 IPC_MESSAGE_HANDLER(ExtensionMsg_SetWebViewPartitionID, 945 IPC_MESSAGE_HANDLER(ExtensionMsg_SetWebViewPartitionID,
946 OnSetWebViewPartitionID) 946 OnSetWebViewPartitionID)
947 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend) 947 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend)
948 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend) 948 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend)
949 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs) 949 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs)
950 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded) 950 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded)
951 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions) 951 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions)
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1106
1107 void Dispatcher::OnMessageInvoke(const std::string& extension_id, 1107 void Dispatcher::OnMessageInvoke(const std::string& extension_id,
1108 const std::string& module_name, 1108 const std::string& module_name,
1109 const std::string& function_name, 1109 const std::string& function_name,
1110 const base::ListValue& args, 1110 const base::ListValue& args,
1111 bool user_gesture) { 1111 bool user_gesture) {
1112 InvokeModuleSystemMethod( 1112 InvokeModuleSystemMethod(
1113 NULL, extension_id, module_name, function_name, args, user_gesture); 1113 NULL, extension_id, module_name, function_name, args, user_gesture);
1114 } 1114 }
1115 1115
1116 void Dispatcher::OnSetChannel(version_info::Channel channel) { 1116 void Dispatcher::OnSetSessionInfo(version_info::Channel channel,
1117 FeatureSessionType session_type) {
1117 SetCurrentChannel(channel); 1118 SetCurrentChannel(channel);
1119 SetCurrentFeatureSessionType(session_type);
1120
1118 if (feature_util::ExtensionServiceWorkersEnabled()) { 1121 if (feature_util::ExtensionServiceWorkersEnabled()) {
1119 // chrome-extension: resources should be allowed to register ServiceWorkers. 1122 // chrome-extension: resources should be allowed to register ServiceWorkers.
1120 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( 1123 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(
1121 blink::WebString::fromUTF8(extensions::kExtensionScheme)); 1124 blink::WebString::fromUTF8(extensions::kExtensionScheme));
1122 } 1125 }
1123 } 1126 }
1124 1127
1125 void Dispatcher::OnSetScriptingWhitelist( 1128 void Dispatcher::OnSetScriptingWhitelist(
1126 const ExtensionsClient::ScriptingWhitelist& extension_ids) { 1129 const ExtensionsClient::ScriptingWhitelist& extension_ids) {
1127 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids); 1130 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids);
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 // The "guestViewDeny" module must always be loaded last. It registers 1670 // The "guestViewDeny" module must always be loaded last. It registers
1668 // error-providing custom elements for the GuestView types that are not 1671 // error-providing custom elements for the GuestView types that are not
1669 // available, and thus all of those types must have been checked and loaded 1672 // available, and thus all of those types must have been checked and loaded
1670 // (or not loaded) beforehand. 1673 // (or not loaded) beforehand.
1671 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1674 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1672 module_system->Require("guestViewDeny"); 1675 module_system->Require("guestViewDeny");
1673 } 1676 }
1674 } 1677 }
1675 1678
1676 } // namespace extensions 1679 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698