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

Unified Diff: chrome/browser/chromeos/login/default_images_view.cc

Issue 7015041: [cros] Update default avatars and guest icon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments 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/chromeos/login/default_images_view.cc
diff --git a/chrome/browser/chromeos/login/default_images_view.cc b/chrome/browser/chromeos/login/default_images_view.cc
index 8996d1038c48d51fa2475fb23a2f1384cdbfa417..25d85aa25df169675a4f4e07fc57542c28083dfb 100644
--- a/chrome/browser/chromeos/login/default_images_view.cc
+++ b/chrome/browser/chromeos/login/default_images_view.cc
@@ -46,6 +46,9 @@ const SkColor kImageBackgroundColor = SK_ColorWHITE;
const int kImageStartId = 100;
// ID for image control for video capture.
const int kCaptureButtonId = 1000;
+// A number of the first buttons that don't correspond to any default image
+// (i.e. button to take a photo).
+const int kNonDefaultImageButtonsCount = 1;
} // namespace
@@ -105,7 +108,13 @@ int DefaultImagesView::GetDefaultImageIndex() const {
if (selected_image_index_ == -1)
return -1;
else
- return selected_image_index_ - 1;
+ return selected_image_index_ - kNonDefaultImageButtonsCount;
+}
+
+void DefaultImagesView::SetDefaultImageIndex(int image_index) {
+ selected_image_index_ = image_index + kNonDefaultImageButtonsCount;
+ if (delegate_)
+ delegate_->OnImageSelected(image_index % kDefaultImagesCount);
}
void DefaultImagesView::ClearSelection() {
@@ -141,9 +150,7 @@ void DefaultImagesView::ButtonPressed(views::Button* sender,
NOTREACHED() << "Got ButtonPressed event from a view with wrong id.";
return;
}
- selected_image_index_ = image_index + 1;
- if (delegate_)
- delegate_->OnImageSelected(image_index % kDefaultImagesCount);
+ SetDefaultImageIndex(image_index);
}
}
« no previous file with comments | « chrome/browser/chromeos/login/default_images_view.h ('k') | chrome/browser/chromeos/login/default_user_images.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698