Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 } | 282 } |
| 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_); |
|
Nirnimesh
2011/07/30 10:32:31
You'd need to get owners review from someone in ch
| |
| 293 ButtonPressed(); | |
| 294 } | |
| 295 | |
| 296 void TakePhotoView::ButtonPressed() { | |
| 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 |
| OLD | NEW |