| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/screens/user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 policy_connector->GetEnterpriseDomain()); | 73 policy_connector->GetEnterpriseDomain()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 std::vector<std::string> kEmptyRecommendedLocales; | 76 std::vector<std::string> kEmptyRecommendedLocales; |
| 77 const std::vector<std::string>& recommended_locales = | 77 const std::vector<std::string>& recommended_locales = |
| 78 public_session_recommended_locales ? | 78 public_session_recommended_locales ? |
| 79 *public_session_recommended_locales : kEmptyRecommendedLocales; | 79 *public_session_recommended_locales : kEmptyRecommendedLocales; |
| 80 | 80 |
| 81 // Construct the list of available locales. This list consists of the | 81 // Construct the list of available locales. This list consists of the |
| 82 // recommended locales, followed by all others. | 82 // recommended locales, followed by all others. |
| 83 scoped_ptr<base::ListValue> available_locales = | 83 std::unique_ptr<base::ListValue> available_locales = |
| 84 GetUILanguageList(&recommended_locales, std::string()); | 84 GetUILanguageList(&recommended_locales, std::string()); |
| 85 | 85 |
| 86 // Select the the first recommended locale that is actually available or the | 86 // Select the the first recommended locale that is actually available or the |
| 87 // current UI locale if none of them are available. | 87 // current UI locale if none of them are available. |
| 88 const std::string selected_locale = FindMostRelevantLocale( | 88 const std::string selected_locale = FindMostRelevantLocale( |
| 89 recommended_locales, | 89 recommended_locales, |
| 90 *available_locales.get(), | 90 *available_locales.get(), |
| 91 g_browser_process->GetApplicationLocale()); | 91 g_browser_process->GetApplicationLocale()); |
| 92 | 92 |
| 93 // Set |kKeyInitialLocales| to the list of available locales. | 93 // Set |kKeyInitialLocales| to the list of available locales. |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } | 466 } |
| 467 | 467 |
| 468 void UserSelectionScreen::ShowBannerMessage(const base::string16& message) { | 468 void UserSelectionScreen::ShowBannerMessage(const base::string16& message) { |
| 469 view_->ShowBannerMessage(message); | 469 view_->ShowBannerMessage(message); |
| 470 } | 470 } |
| 471 | 471 |
| 472 void UserSelectionScreen::ShowUserPodCustomIcon( | 472 void UserSelectionScreen::ShowUserPodCustomIcon( |
| 473 const AccountId& account_id, | 473 const AccountId& account_id, |
| 474 const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions& | 474 const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions& |
| 475 icon_options) { | 475 icon_options) { |
| 476 scoped_ptr<base::DictionaryValue> icon = icon_options.ToDictionaryValue(); | 476 std::unique_ptr<base::DictionaryValue> icon = |
| 477 icon_options.ToDictionaryValue(); |
| 477 if (!icon || icon->empty()) | 478 if (!icon || icon->empty()) |
| 478 return; | 479 return; |
| 479 view_->ShowUserPodCustomIcon(account_id, *icon); | 480 view_->ShowUserPodCustomIcon(account_id, *icon); |
| 480 } | 481 } |
| 481 | 482 |
| 482 void UserSelectionScreen::HideUserPodCustomIcon(const AccountId& account_id) { | 483 void UserSelectionScreen::HideUserPodCustomIcon(const AccountId& account_id) { |
| 483 view_->HideUserPodCustomIcon(account_id); | 484 view_->HideUserPodCustomIcon(account_id); |
| 484 } | 485 } |
| 485 | 486 |
| 486 void UserSelectionScreen::EnableInput() { | 487 void UserSelectionScreen::EnableInput() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 // The user profile should exist if and only if this is the lock screen. | 553 // The user profile should exist if and only if this is the lock screen. |
| 553 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 554 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 554 | 555 |
| 555 if (!profile) | 556 if (!profile) |
| 556 profile = profile_helper->GetSigninProfile(); | 557 profile = profile_helper->GetSigninProfile(); |
| 557 | 558 |
| 558 return EasyUnlockService::Get(profile); | 559 return EasyUnlockService::Get(profile); |
| 559 } | 560 } |
| 560 | 561 |
| 561 } // namespace chromeos | 562 } // namespace chromeos |
| OLD | NEW |