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

Unified Diff: chrome/browser/resources/chromeos/user_images_grid.js

Issue 9856016: Using random wallpaper until user select one (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge and Fix license header Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/user_images_grid.js
diff --git a/chrome/browser/resources/chromeos/user_images_grid.js b/chrome/browser/resources/chromeos/user_images_grid.js
index 457221b3023526d6910390176b96f347f5950d64..e96e004c312fe7ac32c0ca9436fd14105bc1cb75 100644
--- a/chrome/browser/resources/chromeos/user_images_grid.js
+++ b/chrome/browser/resources/chromeos/user_images_grid.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -127,15 +127,21 @@ cr.define('options', function() {
},
set selectedItemUrl(url) {
for (var i = 0, el; el = this.dataModel.item(i); i++) {
- if (el.url === url) {
- this.inProgramSelection_ = true;
- this.selectionModel.selectedIndex = i;
- this.selectionModel.leadIndex = i;
- this.inProgramSelection_ = false;
- }
+ if (el.url === url)
+ this.selectedItemIndex = i;
}
},
+ /**
+ * Set index to the image selected.
+ * @type {number} index The index of selected image.
+ */
+ set selectedItemIndex(index) {
+ this.inProgramSelection_ = true;
+ this.selectionModel.selectedIndex = index;
+ this.inProgramSelection_ = false;
+ },
+
/** @inheritDoc */
get selectedItem() {
var index = this.selectionModel.selectedIndex;

Powered by Google App Engine
This is Rietveld 408576698