Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
index 0a2c84fdd45444a363c30f74f7a02da140f711e6..b88861dd24fc2afe0fc979981d09a8e44b9fabf3 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
#include <algorithm> |
+#include <vector> |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
@@ -74,8 +75,6 @@ |
#include "net/url_request/url_request_context_getter.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
#include "ui/base/webui/web_ui_util.h" |
-#include "ui/gfx/image/image.h" |
-#include "ui/gfx/image/image_skia.h" |
#if defined(USE_AURA) |
#include "ash/shell.h" |
@@ -411,8 +410,6 @@ void SigninScreenHandler::DeclareLocalizedValues( |
builder->Add("confirmPasswordText", IDS_LOGIN_CONFIRM_PASSWORD_TEXT); |
builder->Add("confirmPasswordErrorText", |
IDS_LOGIN_CONFIRM_PASSWORD_ERROR_TEXT); |
- builder->Add("easyUnlockTooltip", |
- IDS_LOGIN_EASY_UNLOCK_TOOLTIP); |
builder->Add("fatalEnrollmentError", |
IDS_ENTERPRISE_ENROLLMENT_AUTH_FATAL_ERROR); |
@@ -513,8 +510,8 @@ void SigninScreenHandler::UpdateUIState(UIState ui_state, |
} |
} |
-// TODO (ygorshenin@): split this method into small parts. |
-// TODO (ygorshenin@): move this logic to GaiaScreenHandler. |
+// TODO(ygorshenin@): split this method into small parts. |
+// TODO(ygorshenin@): move this logic to GaiaScreenHandler. |
void SigninScreenHandler::UpdateStateInternal( |
ErrorScreenActor::ErrorReason reason, |
bool force_update) { |
@@ -923,37 +920,17 @@ void SigninScreenHandler::Observe(int type, |
} |
} |
-void SigninScreenHandler::ShowBannerMessage(const std::string& message) { |
+void SigninScreenHandler::ShowBannerMessage(const base::string16& message) { |
CallJS("login.AccountPickerScreen.showBannerMessage", message); |
} |
void SigninScreenHandler::ShowUserPodCustomIcon( |
const std::string& username, |
- const gfx::Image& icon) { |
- gfx::ImageSkia icon_skia = icon.AsImageSkia(); |
- base::DictionaryValue icon_representations; |
- icon_representations.SetString( |
- "scale1x", |
- webui::GetBitmapDataUrl(icon_skia.GetRepresentation(1.0f).sk_bitmap())); |
- icon_representations.SetString( |
- "scale2x", |
- webui::GetBitmapDataUrl(icon_skia.GetRepresentation(2.0f).sk_bitmap())); |
- CallJS("login.AccountPickerScreen.showUserPodCustomIcon", |
- username, icon_representations); |
- |
- // TODO(tengs): Move this code once we move unlocking to native code. |
- if (ScreenLocker::default_screen_locker()) { |
- UserManager* user_manager = UserManager::Get(); |
- const user_manager::User* user = user_manager->FindUser(username); |
- if (!user) |
- return; |
- PrefService* profile_prefs = |
- ProfileHelper::Get()->GetProfileByUserUnsafe(user)->GetPrefs(); |
- if (profile_prefs->GetBoolean(prefs::kEasyUnlockShowTutorial)) { |
- CallJS("login.AccountPickerScreen.showEasyUnlockBubble"); |
- profile_prefs->SetBoolean(prefs::kEasyUnlockShowTutorial, false); |
- } |
- } |
+ const ScreenlockBridge::UserPodCustomIconOptions& icon_options) { |
+ scoped_ptr<base::DictionaryValue> icon = icon_options.ToDictionaryValue(); |
+ if (!icon || icon->empty()) |
+ return; |
+ CallJS("login.AccountPickerScreen.showUserPodCustomIcon", username, *icon); |
} |
void SigninScreenHandler::HideUserPodCustomIcon(const std::string& username) { |
@@ -968,7 +945,7 @@ void SigninScreenHandler::EnableInput() { |
void SigninScreenHandler::SetAuthType( |
const std::string& username, |
ScreenlockBridge::LockHandler::AuthType auth_type, |
- const std::string& initial_value) { |
+ const base::string16& initial_value) { |
delegate_->SetAuthType(username, auth_type); |
CallJS("login.AccountPickerScreen.setAuthType", |