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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 989 void UserSessionManager::ActivateWizard(const std::string& screen_name) { | 989 void UserSessionManager::ActivateWizard(const std::string& screen_name) { |
| 990 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); | 990 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); |
| 991 CHECK(host); | 991 CHECK(host); |
| 992 scoped_ptr<base::DictionaryValue> params; | 992 scoped_ptr<base::DictionaryValue> params; |
| 993 host->StartWizard(screen_name, params.Pass()); | 993 host->StartWizard(screen_name, params.Pass()); |
| 994 } | 994 } |
| 995 | 995 |
| 996 void UserSessionManager::InitializeStartUrls() const { | 996 void UserSessionManager::InitializeStartUrls() const { |
| 997 std::vector<std::string> start_urls; | 997 std::vector<std::string> start_urls; |
| 998 | 998 |
| 999 const base::ListValue *urls; | |
| 1000 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 999 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 1001 bool can_show_getstarted_guide = | 1000 bool can_show_getstarted_guide = |
| 1002 user_manager->GetActiveUser()->GetType() == | 1001 user_manager->GetActiveUser()->GetType() == |
| 1003 user_manager::USER_TYPE_REGULAR && | 1002 user_manager::USER_TYPE_REGULAR && |
| 1004 !user_manager->IsCurrentUserNonCryptohomeDataEphemeral(); | 1003 !user_manager->IsCurrentUserNonCryptohomeDataEphemeral(); |
| 1005 if (user_manager->IsLoggedInAsDemoUser()) { | 1004 if (!user_manager->IsLoggedInAsPublicAccount()) { |
| 1006 if (CrosSettings::Get()->GetList(kStartUpUrls, &urls)) { | |
| 1007 // The retail mode user will get start URLs from a special policy if it is | |
| 1008 // set. | |
| 1009 for (base::ListValue::const_iterator it = urls->begin(); | |
| 1010 it != urls->end(); ++it) { | |
| 1011 std::string url; | |
| 1012 if ((*it)->GetAsString(&url)) | |
| 1013 start_urls.push_back(url); | |
| 1014 } | |
| 1015 } | |
| 1016 can_show_getstarted_guide = false; | |
| 1017 // Skip the default first-run behavior for public accounts. | |
|
bartfab (slow)
2014/11/27 16:25:47
Nit: This comment should not be removed.
| |
| 1018 } else if (!user_manager->IsLoggedInAsPublicAccount()) { | |
| 1019 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { | 1005 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { |
| 1020 const char* url = kChromeVoxTutorialURLPattern; | 1006 const char* url = kChromeVoxTutorialURLPattern; |
| 1021 PrefService* prefs = g_browser_process->local_state(); | 1007 PrefService* prefs = g_browser_process->local_state(); |
| 1022 const std::string current_locale = | 1008 const std::string current_locale = |
| 1023 base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); | 1009 base::StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); |
| 1024 std::string vox_url = base::StringPrintf(url, current_locale.c_str()); | 1010 std::string vox_url = base::StringPrintf(url, current_locale.c_str()); |
| 1025 start_urls.push_back(vox_url); | 1011 start_urls.push_back(vox_url); |
| 1026 can_show_getstarted_guide = false; | 1012 can_show_getstarted_guide = false; |
| 1027 } | 1013 } |
| 1028 } | 1014 } |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1479 | 1465 |
| 1480 // static | 1466 // static |
| 1481 void UserSessionManager::RunCallbackOnLocaleLoaded( | 1467 void UserSessionManager::RunCallbackOnLocaleLoaded( |
| 1482 const base::Closure& callback, | 1468 const base::Closure& callback, |
| 1483 InputEventsBlocker* /* input_events_blocker */, | 1469 InputEventsBlocker* /* input_events_blocker */, |
| 1484 const locale_util::LanguageSwitchResult& /* result */) { | 1470 const locale_util::LanguageSwitchResult& /* result */) { |
| 1485 callback.Run(); | 1471 callback.Run(); |
| 1486 } | 1472 } |
| 1487 | 1473 |
| 1488 } // namespace chromeos | 1474 } // namespace chromeos |
| OLD | NEW |