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

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

Issue 6248015: DOMUI Prefs: Split search engines into two lists (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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/list_inline_header_selection_controller.js
diff --git a/chrome/browser/resources/options/list_inline_header_selection_controller.js b/chrome/browser/resources/options/list_inline_header_selection_controller.js
deleted file mode 100644
index 2ec57ff3e425da30ef9ede97e7afcaaa146cc31c..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/options/list_inline_header_selection_controller.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) 2010 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 ListSelectionController = cr.ui.ListSelectionController;
-
- /**
- * Creates a selection controller with a delegate that controls whether or
- * not individual items are selectable. This is used for lists containing
- * subgroups with headings that are in the list, since the headers themselves
- * should not be selectable.
- *
- * @param {cr.ui.ListSelectionModel} selectionModel The selection model to
- * interact with.
- * @param {*} selectabilityDelegate A delegate responding to
- * canSelectIndex(index).
- *
- * @constructor
- * @extends {!cr.ui.ListSelectionController}
- */
- function ListInlineHeaderSelectionController(selectionModel,
- selectabilityDelegate) {
- ListSelectionController.call(this, selectionModel);
- this.selectabilityDelegate_ = selectabilityDelegate;
- }
-
- ListInlineHeaderSelectionController.prototype = {
- __proto__: ListSelectionController.prototype,
-
- /** @inheritDoc */
- getIndexBelow: function(index) {
- var next = ListSelectionController.prototype.getIndexBelow.call(this,
- index);
- if (next == -1 || this.canSelect(next))
- return next;
- return this.getIndexBelow(next);
- },
-
- /** @inheritDoc */
- getNextIndex: function(index) {
- return this.getIndexBelow(index);
- },
-
- /** @inheritDoc */
- getIndexAbove: function(index) {
- var previous = ListSelectionController.prototype.getIndexAbove.call(
- this, index);
- if (previous == -1 || this.canSelect(previous))
- return previous;
- return this.getIndexAbove(previous);
- },
-
- /** @inheritDoc */
- getPreviousIndex: function(index) {
- return this.getIndexAbove(index);
- },
-
- /** @inheritDoc */
- getFirstIndex: function(index) {
- var first = ListSelectionController.prototype.getFirstIndex.call(this);
- if (this.canSelect(first))
- return first;
- return this.getNextIndex(first);
- },
-
- /** @inheritDoc */
- getLastIndex: function(index) {
- var last = ListSelectionController.prototype.getLastIndex.call(this);
- if (this.canSelect(last))
- return last;
- return this.getPreviousIndex(last);
- },
-
- /** @inheritDoc */
- handleMouseDownUp: function(e, index) {
- if (this.canSelect(index)) {
- ListSelectionController.prototype.handleMouseDownUp.call(
- this, e, index);
- }
- },
-
- /**
- * Returns true if the given index is selectable.
- * @private
- * @param {number} index The index to check.
- */
- canSelect: function(index) {
- return this.selectabilityDelegate_.canSelectIndex(index);
- }
- };
-
- return {
- ListInlineHeaderSelectionController: ListInlineHeaderSelectionController
- };
-});
« no previous file with comments | « chrome/browser/dom_ui/options/search_engine_manager_handler.cc ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698