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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 // account service. | 136 // account service. |
| 137 static const int kFlagsFetchingLoginTimeoutMs = 1000; | 137 static const int kFlagsFetchingLoginTimeoutMs = 1000; |
| 138 | 138 |
| 139 // The maximum ammount of time that we are willing to delay a browser restart | 139 // The maximum ammount of time that we are willing to delay a browser restart |
| 140 // for, waiting for a session restore to finish. | 140 // for, waiting for a session restore to finish. |
| 141 static const int kMaxRestartDelaySeconds = 10; | 141 static const int kMaxRestartDelaySeconds = 10; |
| 142 | 142 |
| 143 // ChromeVox tutorial URL (used in place of "getting started" url when | 143 // ChromeVox tutorial URL (used in place of "getting started" url when |
| 144 // accessibility is enabled). | 144 // accessibility is enabled). |
| 145 const char kChromeVoxTutorialURLPattern[] = | 145 const char kChromeVoxTutorialURLPattern[] = |
| 146 "http://www.chromevox.com/tutorial/index.html?lang=%s"; | 146 "chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/" |
| 147 "cvox2/background/panel.html?tutorial"; | |
| 147 | 148 |
| 148 void InitLocaleAndInputMethodsForNewUser( | 149 void InitLocaleAndInputMethodsForNewUser( |
| 149 UserSessionManager* session_manager, | 150 UserSessionManager* session_manager, |
| 150 Profile* profile, | 151 Profile* profile, |
| 151 const std::string& public_session_locale, | 152 const std::string& public_session_locale, |
| 152 const std::string& public_session_input_method) { | 153 const std::string& public_session_input_method) { |
| 153 PrefService* prefs = profile->GetPrefs(); | 154 PrefService* prefs = profile->GetPrefs(); |
| 154 std::string locale; | 155 std::string locale; |
| 155 if (!public_session_locale.empty()) { | 156 if (!public_session_locale.empty()) { |
| 156 // If this is a public session and the user chose a |public_session_locale|, | 157 // If this is a public session and the user chose a |public_session_locale|, |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1223 | 1224 |
| 1224 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 1225 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 1225 | 1226 |
| 1226 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() == | 1227 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() == |
| 1227 user_manager::USER_TYPE_REGULAR; | 1228 user_manager::USER_TYPE_REGULAR; |
| 1228 | 1229 |
| 1229 // Skip the default first-run behavior for public accounts. | 1230 // Skip the default first-run behavior for public accounts. |
| 1230 if (!user_manager->IsLoggedInAsPublicAccount()) { | 1231 if (!user_manager->IsLoggedInAsPublicAccount()) { |
| 1231 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { | 1232 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { |
| 1232 const char* url = kChromeVoxTutorialURLPattern; | 1233 const char* url = kChromeVoxTutorialURLPattern; |
| 1233 PrefService* prefs = g_browser_process->local_state(); | 1234 start_urls.push_back(url); |
|
achuithb
2016/10/17 21:37:26
Why not
start_urls.push_back(kChromeVoxTutorialUR
| |
| 1234 const std::string current_locale = | |
| 1235 base::ToLowerASCII(prefs->GetString(prefs::kApplicationLocale)); | |
| 1236 std::string vox_url = base::StringPrintf(url, current_locale.c_str()); | |
| 1237 start_urls.push_back(vox_url); | |
| 1238 can_show_getstarted_guide = false; | 1235 can_show_getstarted_guide = false; |
| 1239 } | 1236 } |
| 1240 } | 1237 } |
| 1241 | 1238 |
| 1242 // Only show getting started guide for a new user. | 1239 // Only show getting started guide for a new user. |
| 1243 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew(); | 1240 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew(); |
| 1244 | 1241 |
| 1245 if (can_show_getstarted_guide && should_show_getstarted_guide) { | 1242 if (can_show_getstarted_guide && should_show_getstarted_guide) { |
| 1246 // Don't open default Chrome window if we're going to launch the first-run | 1243 // Don't open default Chrome window if we're going to launch the first-run |
| 1247 // app. Because we don't want the first-run app to be hidden in the | 1244 // app. Because we don't want the first-run app to be hidden in the |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1893 ->browser_policy_connector_chromeos() | 1890 ->browser_policy_connector_chromeos() |
| 1894 ->IsEnterpriseManaged()) { | 1891 ->IsEnterpriseManaged()) { |
| 1895 return false; | 1892 return false; |
| 1896 } | 1893 } |
| 1897 | 1894 |
| 1898 // Do not show end of life notification if this is a guest session | 1895 // Do not show end of life notification if this is a guest session |
| 1899 return !profile->IsGuestSession(); | 1896 return !profile->IsGuestSession(); |
| 1900 } | 1897 } |
| 1901 | 1898 |
| 1902 } // namespace chromeos | 1899 } // namespace chromeos |
| OLD | NEW |