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

Side by Side Diff: chrome/browser/chromeos/login/take_photo_view.cc

Issue 7523063: Add a hook for capturing a user profile photo and saving it to file and local state. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/chromeos/login/take_photo_view.h" 5 #include "chrome/browser/chromeos/login/take_photo_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/login/helper.h" 8 #include "chrome/browser/chromeos/login/helper.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 gfx::Size TakePhotoView::GetPreferredSize() { 285 gfx::Size TakePhotoView::GetPreferredSize() {
286 return gfx::Size(width(), height()); 286 return gfx::Size(width(), height());
287 } 287 }
288 288
289 void TakePhotoView::ButtonPressed( 289 void TakePhotoView::ButtonPressed(
290 views::Button* sender, const views::Event& event) { 290 views::Button* sender, const views::Event& event) {
291 DCHECK(delegate_); 291 DCHECK(delegate_);
292 DCHECK(sender == snapshot_button_); 292 DCHECK(sender == snapshot_button_);
293 FlipCapturingState();
294 }
295
296 void TakePhotoView::FlipCapturingState() {
293 if (is_capturing_) { 297 if (is_capturing_) {
294 CaptureImage(); 298 CaptureImage();
295 } else { 299 } else {
296 is_capturing_ = true; 300 is_capturing_ = true;
297 snapshot_button_->SetImage( 301 snapshot_button_->SetImage(
298 views::CustomButton::BS_NORMAL, 302 views::CustomButton::BS_NORMAL,
299 ResourceBundle::GetSharedInstance().GetBitmapNamed( 303 ResourceBundle::GetSharedInstance().GetBitmapNamed(
300 IDR_USER_IMAGE_CAPTURE)); 304 IDR_USER_IMAGE_CAPTURE));
301 delegate_->OnCapturingStarted(); 305 delegate_->OnCapturingStarted();
302 snapshot_button_->SchedulePaint(); 306 snapshot_button_->SchedulePaint();
303 } 307 }
304 } 308 }
305 309
306 } // namespace chromeos 310 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/take_photo_view.h ('k') | chrome/browser/chromeos/login/user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698