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/user_image_view.h" | 5 #include "chrome/browser/chromeos/login/user_image_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 user_image_->SetInitializingState(); | 283 user_image_->SetInitializingState(); |
284 } | 284 } |
285 | 285 |
286 void UserImageView::ShowCameraError() { | 286 void UserImageView::ShowCameraError() { |
287 if (!is_capturing_) | 287 if (!is_capturing_) |
288 return; | 288 return; |
289 snapshot_button_->SetEnabled(false); | 289 snapshot_button_->SetEnabled(false); |
290 user_image_->SetErrorState(); | 290 user_image_->SetErrorState(); |
291 } | 291 } |
292 | 292 |
293 void UserImageView::ViewHierarchyChanged(bool is_add, | |
294 views::View* parent, | |
295 views::View* child) { | |
296 if (is_add && this == child) | |
297 WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); | |
298 } | |
299 | |
300 gfx::Size UserImageView::GetPreferredSize() { | 293 gfx::Size UserImageView::GetPreferredSize() { |
301 return gfx::Size(width(), height()); | 294 return gfx::Size(width(), height()); |
302 } | 295 } |
303 | 296 |
304 void UserImageView::ButtonPressed( | 297 void UserImageView::ButtonPressed( |
305 views::Button* sender, const views::Event& event) { | 298 views::Button* sender, const views::Event& event) { |
306 DCHECK(delegate_); | 299 DCHECK(delegate_); |
307 if (sender == snapshot_button_) { | 300 if (sender == snapshot_button_) { |
308 if (is_capturing_) { | 301 if (is_capturing_) { |
309 ok_button_->SetEnabled(true); | 302 ok_button_->SetEnabled(true); |
(...skipping 14 matching lines...) Expand all Loading... |
324 } else if (sender == ok_button_) { | 317 } else if (sender == ok_button_) { |
325 delegate_->OnOK(user_image_->GetImage()); | 318 delegate_->OnOK(user_image_->GetImage()); |
326 } else if (sender == skip_button_) { | 319 } else if (sender == skip_button_) { |
327 delegate_->OnSkip(); | 320 delegate_->OnSkip(); |
328 } else { | 321 } else { |
329 NOTREACHED(); | 322 NOTREACHED(); |
330 } | 323 } |
331 } | 324 } |
332 | 325 |
333 } // namespace chromeos | 326 } // namespace chromeos |
334 | |
OLD | NEW |