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

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

Issue 2912883004: [Extensions Bindings] Don't allow `event` module with native bindings (Closed)
Patch Set: . Created 3 years, 6 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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 kInitialExtensionIdleHandlerDelayMs); 693 kInitialExtensionIdleHandlerDelayMs);
694 } 694 }
695 } 695 }
696 696
697 // static 697 // static
698 std::vector<std::pair<const char*, int>> Dispatcher::GetJsResources() { 698 std::vector<std::pair<const char*, int>> Dispatcher::GetJsResources() {
699 // Libraries. 699 // Libraries.
700 std::vector<std::pair<const char*, int>> resources = { 700 std::vector<std::pair<const char*, int>> resources = {
701 {"appView", IDR_APP_VIEW_JS}, 701 {"appView", IDR_APP_VIEW_JS},
702 {"entryIdManager", IDR_ENTRY_ID_MANAGER}, 702 {"entryIdManager", IDR_ENTRY_ID_MANAGER},
703 {kEventBindings, IDR_EVENT_BINDINGS_JS},
704 {"extensionOptions", IDR_EXTENSION_OPTIONS_JS}, 703 {"extensionOptions", IDR_EXTENSION_OPTIONS_JS},
705 {"extensionOptionsAttributes", IDR_EXTENSION_OPTIONS_ATTRIBUTES_JS}, 704 {"extensionOptionsAttributes", IDR_EXTENSION_OPTIONS_ATTRIBUTES_JS},
706 {"extensionOptionsConstants", IDR_EXTENSION_OPTIONS_CONSTANTS_JS}, 705 {"extensionOptionsConstants", IDR_EXTENSION_OPTIONS_CONSTANTS_JS},
707 {"extensionOptionsEvents", IDR_EXTENSION_OPTIONS_EVENTS_JS}, 706 {"extensionOptionsEvents", IDR_EXTENSION_OPTIONS_EVENTS_JS},
708 {"extensionView", IDR_EXTENSION_VIEW_JS}, 707 {"extensionView", IDR_EXTENSION_VIEW_JS},
709 {"extensionViewApiMethods", IDR_EXTENSION_VIEW_API_METHODS_JS}, 708 {"extensionViewApiMethods", IDR_EXTENSION_VIEW_API_METHODS_JS},
710 {"extensionViewAttributes", IDR_EXTENSION_VIEW_ATTRIBUTES_JS}, 709 {"extensionViewAttributes", IDR_EXTENSION_VIEW_ATTRIBUTES_JS},
711 {"extensionViewConstants", IDR_EXTENSION_VIEW_CONSTANTS_JS}, 710 {"extensionViewConstants", IDR_EXTENSION_VIEW_CONSTANTS_JS},
712 {"extensionViewEvents", IDR_EXTENSION_VIEW_EVENTS_JS}, 711 {"extensionViewEvents", IDR_EXTENSION_VIEW_EVENTS_JS},
713 {"extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS}, 712 {"extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS},
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 {"printerProvider", IDR_PRINTER_PROVIDER_CUSTOM_BINDINGS_JS}, 786 {"printerProvider", IDR_PRINTER_PROVIDER_CUSTOM_BINDINGS_JS},
788 {"runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS}, 787 {"runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS},
789 {"webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS}, 788 {"webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS},
790 789
791 // Platform app sources that are not API-specific.. 790 // Platform app sources that are not API-specific..
792 {"platformApp", IDR_PLATFORM_APP_JS}, 791 {"platformApp", IDR_PLATFORM_APP_JS},
793 }; 792 };
794 793
795 if (!FeatureSwitch::native_crx_bindings()->IsEnabled()) { 794 if (!FeatureSwitch::native_crx_bindings()->IsEnabled()) {
796 resources.emplace_back("binding", IDR_BINDING_JS); 795 resources.emplace_back("binding", IDR_BINDING_JS);
796 resources.emplace_back(kEventBindings, IDR_EVENT_BINDINGS_JS);
797 797
798 // Custom types sources. 798 // Custom types sources.
799 resources.emplace_back("StorageArea", IDR_STORAGE_AREA_JS); 799 resources.emplace_back("StorageArea", IDR_STORAGE_AREA_JS);
800 } 800 }
801 801
802 if (base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) { 802 if (base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) {
803 resources.emplace_back("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS); 803 resources.emplace_back("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS);
804 resources.emplace_back("guestViewIframeContainer", 804 resources.emplace_back("guestViewIframeContainer",
805 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS); 805 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS);
806 } 806 }
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 // The "guestViewDeny" module must always be loaded last. It registers 1480 // The "guestViewDeny" module must always be loaded last. It registers
1481 // error-providing custom elements for the GuestView types that are not 1481 // error-providing custom elements for the GuestView types that are not
1482 // available, and thus all of those types must have been checked and loaded 1482 // available, and thus all of those types must have been checked and loaded
1483 // (or not loaded) beforehand. 1483 // (or not loaded) beforehand.
1484 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1484 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1485 module_system->Require("guestViewDeny"); 1485 module_system->Require("guestViewDeny");
1486 } 1486 }
1487 } 1487 }
1488 1488
1489 } // namespace extensions 1489 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698