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

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: . 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 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/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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_SetChannel, OnSetChannel)
942 IPC_MESSAGE_HANDLER(ExtensionMsg_SetUserSessionType, OnSetUserSessionType)
942 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist, 943 IPC_MESSAGE_HANDLER(ExtensionMsg_SetScriptingWhitelist,
943 OnSetScriptingWhitelist) 944 OnSetScriptingWhitelist)
944 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont) 945 IPC_MESSAGE_HANDLER(ExtensionMsg_SetSystemFont, OnSetSystemFont)
945 IPC_MESSAGE_HANDLER(ExtensionMsg_SetWebViewPartitionID, 946 IPC_MESSAGE_HANDLER(ExtensionMsg_SetWebViewPartitionID,
946 OnSetWebViewPartitionID) 947 OnSetWebViewPartitionID)
947 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend) 948 IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldSuspend, OnShouldSuspend)
948 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend) 949 IPC_MESSAGE_HANDLER(ExtensionMsg_Suspend, OnSuspend)
949 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs) 950 IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs)
950 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded) 951 IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded)
951 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions) 952 IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions)
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1116
1116 void Dispatcher::OnSetChannel(version_info::Channel channel) { 1117 void Dispatcher::OnSetChannel(version_info::Channel channel) {
1117 SetCurrentChannel(channel); 1118 SetCurrentChannel(channel);
1118 if (feature_util::ExtensionServiceWorkersEnabled()) { 1119 if (feature_util::ExtensionServiceWorkersEnabled()) {
1119 // chrome-extension: resources should be allowed to register ServiceWorkers. 1120 // chrome-extension: resources should be allowed to register ServiceWorkers.
1120 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( 1121 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers(
1121 blink::WebString::fromUTF8(extensions::kExtensionScheme)); 1122 blink::WebString::fromUTF8(extensions::kExtensionScheme));
1122 } 1123 }
1123 } 1124 }
1124 1125
1126 void Dispatcher::OnSetUserSessionType(FeatureSessionType session_type) {
1127 SetCurrentFeatureSessionType(session_type);
1128 }
1129
1125 void Dispatcher::OnSetScriptingWhitelist( 1130 void Dispatcher::OnSetScriptingWhitelist(
1126 const ExtensionsClient::ScriptingWhitelist& extension_ids) { 1131 const ExtensionsClient::ScriptingWhitelist& extension_ids) {
1127 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids); 1132 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids);
1128 } 1133 }
1129 1134
1130 void Dispatcher::OnSetSystemFont(const std::string& font_family, 1135 void Dispatcher::OnSetSystemFont(const std::string& font_family,
1131 const std::string& font_size) { 1136 const std::string& font_size) {
1132 system_font_family_ = font_family; 1137 system_font_family_ = font_family;
1133 system_font_size_ = font_size; 1138 system_font_size_ = font_size;
1134 } 1139 }
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 // The "guestViewDeny" module must always be loaded last. It registers 1672 // The "guestViewDeny" module must always be loaded last. It registers
1668 // error-providing custom elements for the GuestView types that are not 1673 // 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 1674 // available, and thus all of those types must have been checked and loaded
1670 // (or not loaded) beforehand. 1675 // (or not loaded) beforehand.
1671 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1676 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1672 module_system->Require("guestViewDeny"); 1677 module_system->Require("guestViewDeny");
1673 } 1678 }
1674 } 1679 }
1675 1680
1676 } // namespace extensions 1681 } // namespace extensions
OLDNEW
« extensions/common/features/feature_session_type.h ('K') | « extensions/renderer/dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698