Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2438893004: Revert of Make ChromeVox Next the default ChromeVox experience (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 "chrome-extension://mndnfokpggljbaajbnioimlmbfngpief/" 144 "http://www.chromevox.com/tutorial/index.html?lang=%s";
145 "cvox2/background/panel.html?tutorial";
146 145
147 void InitLocaleAndInputMethodsForNewUser( 146 void InitLocaleAndInputMethodsForNewUser(
148 UserSessionManager* session_manager, 147 UserSessionManager* session_manager,
149 Profile* profile, 148 Profile* profile,
150 const std::string& public_session_locale, 149 const std::string& public_session_locale,
151 const std::string& public_session_input_method) { 150 const std::string& public_session_input_method) {
152 PrefService* prefs = profile->GetPrefs(); 151 PrefService* prefs = profile->GetPrefs();
153 std::string locale; 152 std::string locale;
154 if (!public_session_locale.empty()) { 153 if (!public_session_locale.empty()) {
155 // If this is a public session and the user chose a |public_session_locale|, 154 // 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
1222 1221
1223 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 1222 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
1224 1223
1225 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() == 1224 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() ==
1226 user_manager::USER_TYPE_REGULAR; 1225 user_manager::USER_TYPE_REGULAR;
1227 1226
1228 // Skip the default first-run behavior for public accounts. 1227 // Skip the default first-run behavior for public accounts.
1229 if (!user_manager->IsLoggedInAsPublicAccount()) { 1228 if (!user_manager->IsLoggedInAsPublicAccount()) {
1230 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { 1229 if (AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) {
1231 const char* url = kChromeVoxTutorialURLPattern; 1230 const char* url = kChromeVoxTutorialURLPattern;
1232 start_urls.push_back(url); 1231 PrefService* prefs = g_browser_process->local_state();
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);
1233 can_show_getstarted_guide = false; 1236 can_show_getstarted_guide = false;
1234 } 1237 }
1235 } 1238 }
1236 1239
1237 // Only show getting started guide for a new user. 1240 // Only show getting started guide for a new user.
1238 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew(); 1241 const bool should_show_getstarted_guide = user_manager->IsCurrentUserNew();
1239 1242
1240 if (can_show_getstarted_guide && should_show_getstarted_guide) { 1243 if (can_show_getstarted_guide && should_show_getstarted_guide) {
1241 // Don't open default Chrome window if we're going to launch the first-run 1244 // Don't open default Chrome window if we're going to launch the first-run
1242 // app. Because we don't want the first-run app to be hidden in the 1245 // 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
1880 ->browser_policy_connector_chromeos() 1883 ->browser_policy_connector_chromeos()
1881 ->IsEnterpriseManaged()) { 1884 ->IsEnterpriseManaged()) {
1882 return false; 1885 return false;
1883 } 1886 }
1884 1887
1885 // Do not show end of life notification if this is a guest session 1888 // Do not show end of life notification if this is a guest session
1886 return !profile->IsGuestSession(); 1889 return !profile->IsGuestSession();
1887 } 1890 }
1888 1891
1889 } // namespace chromeos 1892 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698