Chromium Code Reviews| 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 992 void UserSessionManager::ActivateWizard(const std::string& screen_name) { | 992 void UserSessionManager::ActivateWizard(const std::string& screen_name) { |
| 993 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); | 993 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); |
| 994 CHECK(host); | 994 CHECK(host); |
| 995 scoped_ptr<base::DictionaryValue> params; | 995 scoped_ptr<base::DictionaryValue> params; |
| 996 host->StartWizard(screen_name, params.Pass()); | 996 host->StartWizard(screen_name, params.Pass()); |
| 997 } | 997 } |
| 998 | 998 |
| 999 void UserSessionManager::InitializeStartUrls() const { | 999 void UserSessionManager::InitializeStartUrls() const { |
| 1000 std::vector<std::string> start_urls; | 1000 std::vector<std::string> start_urls; |
| 1001 | 1001 |
| 1002 const base::ListValue *urls; | |
| 1003 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 1002 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 1004 bool can_show_getstarted_guide = | 1003 bool can_show_getstarted_guide = |
| 1005 user_manager->GetActiveUser()->GetType() == | 1004 user_manager->GetActiveUser()->GetType() == |
| 1006 user_manager::USER_TYPE_REGULAR && | 1005 user_manager::USER_TYPE_REGULAR && |
| 1007 !user_manager->IsCurrentUserNonCryptohomeDataEphemeral(); | 1006 !user_manager->IsCurrentUserNonCryptohomeDataEphemeral(); |
| 1008 if (user_manager->IsLoggedInAsDemoUser()) { | 1007 if (!user_manager->IsLoggedInAsPublicAccount()) { |
| 1009 if (CrosSettings::Get()->GetList(kStartUpUrls, &urls)) { | |
| 1010 // The retail mode user will get start URLs from a special policy if it is | |
| 1011 // set. | |
| 1012 for (base::ListValue::const_iterator it = urls->begin(); | |
| 1013 it != urls->end(); ++it) { | |
| 1014 std::string url; | |
| 1015 if ((*it)->GetAsString(&url)) | |
| 1016 start_urls.push_back(url); | |
| 1017 } | |
| 1018 } | |
| 1019 can_show_getstarted_guide = false; | |
| 1020 // Skip the default first-run behavior for public accounts. | |
|
bartfab (slow)
2014/12/02 21:25:27
Nit: Leave this comment in place please.
rkc
2014/12/04 19:50:06
Done.
| |
| 1021 } else if (!user_manager->IsLoggedInAsPublicAccount()) { | |
| 1022 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { | 1008 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { |
| 1023 const char* url = kChromeVoxTutorialURLPattern; | 1009 const char* url = kChromeVoxTutorialURLPattern; |
| 1024 PrefService* prefs = g_browser_process->local_state(); | 1010 PrefService* prefs = g_browser_process->local_state(); |
| 1025 const std::string current_locale = | 1011 const std::string current_locale = |
| 1026 base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); | 1012 base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); |
| 1027 std::string vox_url = base::StringPrintf(url, current_locale.c_str()); | 1013 std::string vox_url = base::StringPrintf(url, current_locale.c_str()); |
| 1028 start_urls.push_back(vox_url); | 1014 start_urls.push_back(vox_url); |
| 1029 can_show_getstarted_guide = false; | 1015 can_show_getstarted_guide = false; |
| 1030 } | 1016 } |
| 1031 } | 1017 } |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1486 InputEventsBlocker* /* input_events_blocker */, | 1472 InputEventsBlocker* /* input_events_blocker */, |
| 1487 const locale_util::LanguageSwitchResult& /* result */) { | 1473 const locale_util::LanguageSwitchResult& /* result */) { |
| 1488 callback.Run(); | 1474 callback.Run(); |
| 1489 } | 1475 } |
| 1490 | 1476 |
| 1491 void UserSessionManager::RemoveProfileForTesting(Profile* profile) { | 1477 void UserSessionManager::RemoveProfileForTesting(Profile* profile) { |
| 1492 default_ime_states_.erase(profile); | 1478 default_ime_states_.erase(profile); |
| 1493 } | 1479 } |
| 1494 | 1480 |
| 1495 } // namespace chromeos | 1481 } // namespace chromeos |
| OLD | NEW |