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

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

Issue 1026703004: Refactored extensionOptions to use the new guestViewAttributes module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 5 years, 9 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // static 471 // static
472 std::vector<std::pair<std::string, int> > Dispatcher::GetJsResources() { 472 std::vector<std::pair<std::string, int> > Dispatcher::GetJsResources() {
473 std::vector<std::pair<std::string, int> > resources; 473 std::vector<std::pair<std::string, int> > resources;
474 474
475 // Libraries. 475 // Libraries.
476 resources.push_back(std::make_pair("appView", IDR_APP_VIEW_JS)); 476 resources.push_back(std::make_pair("appView", IDR_APP_VIEW_JS));
477 resources.push_back(std::make_pair("entryIdManager", IDR_ENTRY_ID_MANAGER)); 477 resources.push_back(std::make_pair("entryIdManager", IDR_ENTRY_ID_MANAGER));
478 resources.push_back(std::make_pair(kEventBindings, IDR_EVENT_BINDINGS_JS)); 478 resources.push_back(std::make_pair(kEventBindings, IDR_EVENT_BINDINGS_JS));
479 resources.push_back(std::make_pair("extensionOptions", 479 resources.push_back(std::make_pair("extensionOptions",
480 IDR_EXTENSION_OPTIONS_JS)); 480 IDR_EXTENSION_OPTIONS_JS));
481 resources.push_back(std::make_pair("extensionOptionsAttributes",
482 IDR_EXTENSION_OPTIONS_ATTRIBUTES_JS));
483 resources.push_back(std::make_pair("extensionOptionsConstants",
484 IDR_EXTENSION_OPTIONS_CONSTANTS_JS));
481 resources.push_back(std::make_pair("extensionOptionsEvents", 485 resources.push_back(std::make_pair("extensionOptionsEvents",
482 IDR_EXTENSION_OPTIONS_EVENTS_JS)); 486 IDR_EXTENSION_OPTIONS_EVENTS_JS));
483 resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS)); 487 resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS));
484 resources.push_back(std::make_pair("extensionViewApiMethods", 488 resources.push_back(std::make_pair("extensionViewApiMethods",
485 IDR_EXTENSION_VIEW_API_METHODS_JS)); 489 IDR_EXTENSION_VIEW_API_METHODS_JS));
486 resources.push_back(std::make_pair("extensionViewAttributes", 490 resources.push_back(std::make_pair("extensionViewAttributes",
487 IDR_EXTENSION_VIEW_ATTRIBUTES_JS)); 491 IDR_EXTENSION_VIEW_ATTRIBUTES_JS));
488 resources.push_back(std::make_pair("extensionViewConstants", 492 resources.push_back(std::make_pair("extensionViewConstants",
489 IDR_EXTENSION_VIEW_CONSTANTS_JS)); 493 IDR_EXTENSION_VIEW_CONSTANTS_JS));
490 resources.push_back(std::make_pair("extensionViewEvents", 494 resources.push_back(std::make_pair("extensionViewEvents",
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 ModuleSystem* module_system = context->module_system(); 1406 ModuleSystem* module_system = context->module_system();
1403 1407
1404 // Require AppView. 1408 // Require AppView.
1405 if (context->GetAvailability("appViewEmbedderInternal").is_available()) { 1409 if (context->GetAvailability("appViewEmbedderInternal").is_available()) {
1406 module_system->Require("appView"); 1410 module_system->Require("appView");
1407 } 1411 }
1408 1412
1409 // Require ExtensionOptions. 1413 // Require ExtensionOptions.
1410 if (context->GetAvailability("extensionOptionsInternal").is_available()) { 1414 if (context->GetAvailability("extensionOptionsInternal").is_available()) {
1411 module_system->Require("extensionOptions"); 1415 module_system->Require("extensionOptions");
1416 module_system->Require("extensionOptionsAttributes");
1412 } 1417 }
1413 1418
1414 // Require ExtensionView. 1419 // Require ExtensionView.
1415 if (context->GetAvailability("extensionViewInternal").is_available()) { 1420 if (context->GetAvailability("extensionViewInternal").is_available()) {
1416 module_system->Require("extensionView"); 1421 module_system->Require("extensionView");
1417 module_system->Require("extensionViewApiMethods"); 1422 module_system->Require("extensionViewApiMethods");
1418 module_system->Require("extensionViewAttributes"); 1423 module_system->Require("extensionViewAttributes");
1419 } 1424 }
1420 1425
1421 // Require SurfaceView. 1426 // Require SurfaceView.
(...skipping 12 matching lines...) Expand all
1434 // The "guestViewDeny" module must always be loaded last. It registers 1439 // The "guestViewDeny" module must always be loaded last. It registers
1435 // error-providing custom elements for the GuestView types that are not 1440 // error-providing custom elements for the GuestView types that are not
1436 // available, and thus all of those types must have been checked and loaded 1441 // available, and thus all of those types must have been checked and loaded
1437 // (or not loaded) beforehand. 1442 // (or not loaded) beforehand.
1438 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1443 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1439 module_system->Require("guestViewDeny"); 1444 module_system->Require("guestViewDeny");
1440 } 1445 }
1441 } 1446 }
1442 1447
1443 } // namespace extensions 1448 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698