| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/user_image_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" |
| 6 | 6 |
| 7 #include "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 12 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 13 #include "chrome/browser/chromeos/login/screens/user_image_model.h" | 13 #include "chrome/browser/chromeos/login/screens/user_image_model.h" |
| 14 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 14 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 15 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 15 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 19 #include "chromeos/audio/chromeos_sounds.h" | 19 #include "chromeos/audio/chromeos_sounds.h" |
| 20 #include "components/login/localized_values_builder.h" |
| 20 #include "components/user_manager/user.h" | 21 #include "components/user_manager/user.h" |
| 21 #include "components/user_manager/user_image/default_user_images.h" | 22 #include "components/user_manager/user_image/default_user_images.h" |
| 22 #include "grit/browser_resources.h" | 23 #include "grit/browser_resources.h" |
| 23 #include "media/audio/sounds/sounds_manager.h" | 24 #include "media/audio/sounds/sounds_manager.h" |
| 24 #include "net/base/data_url.h" | 25 #include "net/base/data_url.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 model_->OnScreenReady(); | 83 model_->OnScreenReady(); |
| 83 } | 84 } |
| 84 | 85 |
| 85 void UserImageScreenHandler::Hide() { | 86 void UserImageScreenHandler::Hide() { |
| 86 } | 87 } |
| 87 | 88 |
| 88 void UserImageScreenHandler::PrepareToShow() { | 89 void UserImageScreenHandler::PrepareToShow() { |
| 89 } | 90 } |
| 90 | 91 |
| 91 void UserImageScreenHandler::DeclareLocalizedValues( | 92 void UserImageScreenHandler::DeclareLocalizedValues( |
| 92 LocalizedValuesBuilder* builder) { | 93 ::login::LocalizedValuesBuilder* builder) { |
| 93 builder->Add("userImageScreenTitle", IDS_USER_IMAGE_SCREEN_TITLE); | 94 builder->Add("userImageScreenTitle", IDS_USER_IMAGE_SCREEN_TITLE); |
| 94 builder->Add("userImageScreenDescription", | 95 builder->Add("userImageScreenDescription", |
| 95 IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT); | 96 IDS_OPTIONS_CHANGE_PICTURE_DIALOG_TEXT); |
| 96 builder->Add("takePhoto", IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO); | 97 builder->Add("takePhoto", IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO); |
| 97 builder->Add("discardPhoto", IDS_OPTIONS_CHANGE_PICTURE_DISCARD_PHOTO); | 98 builder->Add("discardPhoto", IDS_OPTIONS_CHANGE_PICTURE_DISCARD_PHOTO); |
| 98 builder->Add("flipPhoto", IDS_OPTIONS_CHANGE_PICTURE_FLIP_PHOTO); | 99 builder->Add("flipPhoto", IDS_OPTIONS_CHANGE_PICTURE_FLIP_PHOTO); |
| 99 builder->Add("profilePhoto", IDS_IMAGE_SCREEN_PROFILE_PHOTO); | 100 builder->Add("profilePhoto", IDS_IMAGE_SCREEN_PROFILE_PHOTO); |
| 100 builder->Add("profilePhotoLoading", | 101 builder->Add("profilePhotoLoading", |
| 101 IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO); | 102 IDS_IMAGE_SCREEN_PROFILE_LOADING_PHOTO); |
| 102 builder->Add("okButtonText", IDS_OK); | 103 builder->Add("okButtonText", IDS_OK); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 base::TimeDelta delta = base::Time::Now() - screen_show_time_; | 189 base::TimeDelta delta = base::Time::Now() - screen_show_time_; |
| 189 VLOG(1) << "Screen load time: " << delta.InSecondsF(); | 190 VLOG(1) << "Screen load time: " << delta.InSecondsF(); |
| 190 UMA_HISTOGRAM_TIMES("UserImage.ScreenIsShownTime", delta); | 191 UMA_HISTOGRAM_TIMES("UserImage.ScreenIsShownTime", delta); |
| 191 } | 192 } |
| 192 | 193 |
| 193 void UserImageScreenHandler::HideCurtain() { | 194 void UserImageScreenHandler::HideCurtain() { |
| 194 CallJS("hideCurtain"); | 195 CallJS("hideCurtain"); |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace chromeos | 198 } // namespace chromeos |
| OLD | NEW |