| 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/options/take_photo_dialog.h" | 5 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chromeos/login/helper.h" | 9 #include "chrome/browser/chromeos/login/helper.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "content/common/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
| 12 #include "grit/chromium_strings.h" | 12 #include "grit/chromium_strings.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 #include "grit/locale_settings.h" | 14 #include "grit/locale_settings.h" |
| 15 #include "ui/base/accessibility/accessible_view_state.h" | 15 #include "ui/base/accessibility/accessible_view_state.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "views/layout/layout_constants.h" | 17 #include "views/layout/layout_constants.h" |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // The resolution of the picture we want to get from the camera. | 23 // The resolution of the picture we want to get from the camera. |
| 24 const int kFrameWidth = 480; | 24 const int kFrameWidth = 480; |
| 25 const int kFrameHeight = 480; | 25 const int kFrameHeight = 480; |
| 26 | 26 |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 TakePhotoDialog::TakePhotoDialog(Delegate* delegate) | 29 TakePhotoDialog::TakePhotoDialog(Delegate* delegate) |
| 30 : take_photo_view_(NULL), | 30 : take_photo_view_(NULL), |
| 31 camera_controller_(this), | 31 camera_controller_(this), |
| 32 delegate_(delegate) { | 32 delegate_(delegate) { |
| 33 camera_controller_.set_frame_width(kFrameWidth); | 33 camera_controller_.set_frame_width(kFrameWidth); |
| 34 camera_controller_.set_frame_height(kFrameHeight); | 34 camera_controller_.set_frame_height(kFrameHeight); |
| 35 registrar_.Add( | 35 registrar_.Add( |
| 36 this, | 36 this, |
| 37 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 37 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 38 NotificationService::AllSources()); | 38 content::NotificationService::AllSources()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 TakePhotoDialog::~TakePhotoDialog() { | 41 TakePhotoDialog::~TakePhotoDialog() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool TakePhotoDialog::IsDialogButtonEnabled( | 44 bool TakePhotoDialog::IsDialogButtonEnabled( |
| 45 MessageBoxFlags::DialogButton button) const { | 45 MessageBoxFlags::DialogButton button) const { |
| 46 if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) | 46 if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) |
| 47 return true; | 47 return true; |
| 48 else if (button == MessageBoxFlags::DIALOGBUTTON_OK) | 48 else if (button == MessageBoxFlags::DIALOGBUTTON_OK) |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 gfx::Size TakePhotoDialog::GetPreferredSize() { | 162 gfx::Size TakePhotoDialog::GetPreferredSize() { |
| 163 return gfx::Size(login::kUserImageSize * 2, (login::kUserImageSize * 3 / 2)); | 163 return gfx::Size(login::kUserImageSize * 2, (login::kUserImageSize * 3 / 2)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void TakePhotoDialog::InitCamera() { | 166 void TakePhotoDialog::InitCamera() { |
| 167 take_photo_view_->ShowCameraInitializing(); | 167 take_photo_view_->ShowCameraInitializing(); |
| 168 camera_controller_.Start(); | 168 camera_controller_.Start(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace chromeos | 171 } // namespace chromeos |
| OLD | NEW |