OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/lock.h" | 10 #include "base/lock.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
45 #include "googleurl/src/gurl.h" | 45 #include "googleurl/src/gurl.h" |
46 #include "net/base/cookie_store.h" | 46 #include "net/base/cookie_store.h" |
47 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
48 #include "views/widget/widget_gtk.h" | 48 #include "views/widget/widget_gtk.h" |
49 | 49 |
50 namespace chromeos { | 50 namespace chromeos { |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 | |
55 // Prefix for Auth token received from ClientLogin request. | 54 // Prefix for Auth token received from ClientLogin request. |
56 const char kAuthPrefix[] = "Auth="; | 55 const char kAuthPrefix[] = "Auth="; |
57 // Suffix for Auth token received from ClientLogin request. | 56 // Suffix for Auth token received from ClientLogin request. |
58 const char kAuthSuffix[] = "\n"; | 57 const char kAuthSuffix[] = "\n"; |
59 | 58 |
60 } // namespace | 59 } // namespace |
61 | 60 |
62 class LoginUtilsImpl : public LoginUtils { | 61 class LoginUtilsImpl : public LoginUtils { |
63 public: | 62 public: |
64 LoginUtilsImpl() | 63 LoginUtilsImpl() |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 language_preload_engines.SetValue(preload_engines); | 231 language_preload_engines.SetValue(preload_engines); |
233 | 232 |
234 // Add the UI language to the preferred languages the user first logs in. | 233 // Add the UI language to the preferred languages the user first logs in. |
235 std::string preferred_languages(locale); | 234 std::string preferred_languages(locale); |
236 preferred_languages += ","; | 235 preferred_languages += ","; |
237 preferred_languages += kFallbackInputMethodLocale; | 236 preferred_languages += kFallbackInputMethodLocale; |
238 language_preferred_languages.SetValue(preferred_languages); | 237 language_preferred_languages.SetValue(preferred_languages); |
239 btl->AddLoginTimeMarker("IMESTarted", false); | 238 btl->AddLoginTimeMarker("IMESTarted", false); |
240 } | 239 } |
241 } | 240 } |
| 241 |
| 242 // We suck. This is a hack since we do not have the enterprise feature |
| 243 // done yet to pull down policies from the domain admin. We'll take this |
| 244 // out when we get that done properly. |
| 245 // TODO(xiyuan): Remove this once enterprise feature is ready. |
| 246 if (EndsWith(username, "@google.com", true)) { |
| 247 PrefService* pref_service = profile->GetPrefs(); |
| 248 pref_service->SetBoolean(prefs::kEnableScreenLock, true); |
| 249 } |
| 250 |
242 DoBrowserLaunch(profile); | 251 DoBrowserLaunch(profile); |
243 } | 252 } |
244 | 253 |
245 void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { | 254 void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { |
246 VLOG(1) << "Completing off the record login"; | 255 VLOG(1) << "Completing off the record login"; |
247 | 256 |
248 UserManager::Get()->OffTheRecordUserLoggedIn(); | 257 UserManager::Get()->OffTheRecordUserLoggedIn(); |
249 | 258 |
250 if (CrosLibrary::Get()->EnsureLoaded()) { | 259 if (CrosLibrary::Get()->EnsureLoaded()) { |
251 // For guest session we ask session manager to restart Chrome with --bwsi | 260 // For guest session we ask session manager to restart Chrome with --bwsi |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 BrowserInit browser_init; | 361 BrowserInit browser_init; |
353 int return_code; | 362 int return_code; |
354 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 363 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
355 profile, | 364 profile, |
356 FilePath(), | 365 FilePath(), |
357 true, | 366 true, |
358 &return_code); | 367 &return_code); |
359 } | 368 } |
360 | 369 |
361 } // namespace chromeos | 370 } // namespace chromeos |
OLD | NEW |