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