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

Unified Diff: chrome/browser/resources/options/search_engine_manager.js

Issue 7003007: Apply content-security-policy to the HTML options page. This is a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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: chrome/browser/resources/options/search_engine_manager.js
===================================================================
--- chrome/browser/resources/options/search_engine_manager.js (revision 84868)
+++ chrome/browser/resources/options/search_engine_manager.js (working copy)
@@ -1,98 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-cr.define('options', function() {
- const OptionsPage = options.OptionsPage;
- const ArrayDataModel = cr.ui.ArrayDataModel;
-
- /**
- * Encapsulated handling of search engine management page.
- * @constructor
- */
- function SearchEngineManager() {
- this.activeNavTab = null;
- OptionsPage.call(this, 'searchEngines',
- templateData.searchEngineManagerPageTabTitle,
- 'searchEngineManagerPage');
- }
-
- cr.addSingletonGetter(SearchEngineManager);
-
- SearchEngineManager.prototype = {
- __proto__: OptionsPage.prototype,
-
- /**
- * List for default search engine options
- * @type {boolean}
- * @private
- */
- defaultsList_: null,
-
- /**
- * List for other search engine options
- * @type {boolean}
- * @private
- */
- othersList_: null,
-
- /** inheritDoc */
- initializePage: function() {
- OptionsPage.prototype.initializePage.call(this);
-
- this.defaultsList_ = $('defaultSearchEngineList');
- this.setUpList_(this.defaultsList_);
-
- this.othersList_ = $('otherSearchEngineList');
- this.setUpList_(this.othersList_);
- },
-
- /**
- * Sets up the given list as a search engine list
- * @param {List} list The list to set up.
- * @private
- */
- setUpList_: function(list) {
- options.search_engines.SearchEngineList.decorate(list);
- list.autoExpands = true;
- },
-
- /**
- * Updates the search engine list with the given entries.
- * @private
- * @param {Array} defaultEngines List of possible default search engines.
- * @param {Array} otherEngines List of other search engines.
- */
- updateSearchEngineList_: function(defaultEngines, otherEngines) {
- this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines);
- var othersModel = new ArrayDataModel(otherEngines);
- // Add a "new engine" row.
- othersModel.push({
- 'modelIndex': '-1'
- });
- this.othersList_.dataModel = othersModel;
- },
- };
-
- SearchEngineManager.updateSearchEngineList = function(defaultEngines,
- otherEngines) {
- SearchEngineManager.getInstance().updateSearchEngineList_(defaultEngines,
- otherEngines);
- };
-
- SearchEngineManager.validityCheckCallback = function(validity, modelIndex) {
- // Forward to both lists; the one without a matching modelIndex will ignore
- // it.
- SearchEngineManager.getInstance().defaultsList_.validationComplete(
- validity, modelIndex);
- SearchEngineManager.getInstance().othersList_.validationComplete(
- validity, modelIndex);
- };
-
- // Export
- return {
- SearchEngineManager: SearchEngineManager
- };
-
-});
-

Powered by Google App Engine
This is Rietveld 408576698