summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authorivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 19:55:34 +0000
committerivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 19:55:34 +0000
commite121969dd45f75c4a8c09e8cca254f89375ec377 (patch)
tree0ea013a849bb1985f162e9409e745ff777499a2e /chrome/browser/resources
parentab2e239a454a17a10f3545b8b8436bc838133092 (diff)
downloadchromium_src-e121969dd45f75c4a8c09e8cca254f89375ec377.zip
chromium_src-e121969dd45f75c4a8c09e8cca254f89375ec377.tar.gz
chromium_src-e121969dd45f75c4a8c09e8cca254f89375ec377.tar.bz2
[cros] Rename UserImagesGrid.findItem to indexOf.
As suggested by arv in http://codereview.chromium.org/8283004/ BUG=none TEST=none Review URL: http://codereview.chromium.org/8362005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/chromeos/user_images_grid.js8
-rw-r--r--chrome/browser/resources/options/chromeos/change_picture_options.js2
2 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/resources/chromeos/user_images_grid.js b/chrome/browser/resources/chromeos/user_images_grid.js
index 6fe9a28..2330271 100644
--- a/chrome/browser/resources/chromeos/user_images_grid.js
+++ b/chrome/browser/resources/chromeos/user_images_grid.js
@@ -139,7 +139,7 @@ cr.define('options', function() {
return index != -1 ? this.dataModel.item(index) : null;
},
set selectedItem(selectedItem) {
- var index = this.findItem(selectedItem);
+ var index = this.indexOf(selectedItem);
this.inProgramSelection_ = true;
this.selectionModel.selectedIndex = index;
this.selectionModel.leadIndex = index;
@@ -175,7 +175,7 @@ cr.define('options', function() {
* @param {Object} imageInfo Image data returned from addItem() call.
* @return {number} Image index (0-based) or -1 if image was not found.
*/
- findItem: function(imageInfo) {
+ indexOf: function(imageInfo) {
return this.dataModel.indexOf(imageInfo);
},
@@ -188,7 +188,7 @@ cr.define('options', function() {
* @return {!Object} Image data of the added or updated image.
*/
updateItem: function(imageInfo, imageUrl, opt_title) {
- var imageIndex = this.findItem(imageInfo);
+ var imageIndex = this.indexOf(imageInfo);
var wasSelected = this.selectionModel.selectedIndex == imageIndex;
this.removeItem(imageInfo);
var newInfo = this.addItem(
@@ -206,7 +206,7 @@ cr.define('options', function() {
* @param {Object} imageInfo Image data returned from the addItem() call.
*/
removeItem: function(imageInfo) {
- var index = this.findItem(imageInfo);
+ var index = this.indexOf(imageInfo);
if (index != -1) {
this.inProgramSelection_ = true;
this.dataModel.splice(index, 1);
diff --git a/chrome/browser/resources/options/chromeos/change_picture_options.js b/chrome/browser/resources/options/chromeos/change_picture_options.js
index ac3d895..ad62d58 100644
--- a/chrome/browser/resources/options/chromeos/change_picture_options.js
+++ b/chrome/browser/resources/options/chromeos/change_picture_options.js
@@ -186,7 +186,7 @@ cr.define('options', function() {
this.oldImage_ = imageGrid.updateItem(this.oldImage_, url);
} else {
// Insert next to the profile image.
- var pos = imageGrid.findItem(this.profileImage_) + 1;
+ var pos = imageGrid.indexOf(this.profileImage_) + 1;
this.oldImage_ = imageGrid.addItem(url, undefined, undefined, pos);
imageGrid.selectedItem = this.oldImage_;
}