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

Side by Side Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js

Issue 14244011: Fix custom wallpaper going back from wallpaper 2 to wallpaper 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flackr's review Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 cr.define('wallpapers', function() { 5 cr.define('wallpapers', function() {
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel;
7 /** @const */ var Grid = cr.ui.Grid; 7 /** @const */ var Grid = cr.ui.Grid;
8 /** @const */ var GridItem = cr.ui.GridItem; 8 /** @const */ var GridItem = cr.ui.GridItem;
9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController;
10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 }, 240 },
241 set selectedItem(selectedItem) { 241 set selectedItem(selectedItem) {
242 var index = this.dataModel.indexOf(selectedItem); 242 var index = this.dataModel.indexOf(selectedItem);
243 this.inProgramSelection_ = true; 243 this.inProgramSelection_ = true;
244 this.selectionModel.leadIndex = index; 244 this.selectionModel.leadIndex = index;
245 this.selectionModel.selectedIndex = index; 245 this.selectionModel.selectedIndex = index;
246 this.inProgramSelection_ = false; 246 this.inProgramSelection_ = false;
247 }, 247 },
248 248
249 /** 249 /**
250 * The previous selected item.
251 * @type {!Object} Wallpaper information in the data model.
252 */
253 previousSelectedItem_: undefined,
254 get previousSelectedItem() {
255 return this.previousSelectedItem_;
256 },
257 set previousSelectedItem(selectedItem) {
258 this.previousSelectedItem_ = selectedItem;
259 },
260
261 /**
250 * Forces re-display, size re-calculation and focuses grid. 262 * Forces re-display, size re-calculation and focuses grid.
251 */ 263 */
252 updateAndFocus: function() { 264 updateAndFocus: function() {
253 // Recalculate the measured item size. 265 // Recalculate the measured item size.
254 this.measured_ = null; 266 this.measured_ = null;
255 this.columns = 0; 267 this.columns = 0;
256 this.redraw(); 268 this.redraw();
257 this.focus(); 269 this.focus();
258 }, 270 },
259 271
(...skipping 27 matching lines...) Expand all
287 // to make sure checkmark shows correctly. 299 // to make sure checkmark shows correctly.
288 this.updateActiveThumb_(); 300 this.updateActiveThumb_();
289 } 301 }
290 }; 302 };
291 303
292 return { 304 return {
293 WallpaperSourceEnum: WallpaperSourceEnum, 305 WallpaperSourceEnum: WallpaperSourceEnum,
294 WallpaperThumbnailsGrid: WallpaperThumbnailsGrid 306 WallpaperThumbnailsGrid: WallpaperThumbnailsGrid
295 }; 307 };
296 }); 308 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698