OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/base_paths.h" | 11 #include "base/base_paths.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/singleton.h" | 20 #include "base/memory/singleton.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/path_service.h" | |
23 #include "base/prefs/pref_member.h" | 22 #include "base/prefs/pref_member.h" |
24 #include "base/prefs/pref_service.h" | 23 #include "base/prefs/pref_service.h" |
25 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
26 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
27 #include "base/synchronization/lock.h" | 26 #include "base/synchronization/lock.h" |
28 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
29 #include "base/task_runner_util.h" | 28 #include "base/task_runner_util.h" |
30 #include "base/threading/worker_pool.h" | 29 #include "base/threading/worker_pool.h" |
31 #include "base/time/time.h" | 30 #include "base/time/time.h" |
32 #include "chrome/browser/about_flags.h" | 31 #include "chrome/browser/about_flags.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 #include "google_apis/gaia/gaia_auth_consumer.h" | 81 #include "google_apis/gaia/gaia_auth_consumer.h" |
83 #include "net/base/network_change_notifier.h" | 82 #include "net/base/network_change_notifier.h" |
84 #include "net/url_request/url_request_context.h" | 83 #include "net/url_request/url_request_context.h" |
85 #include "net/url_request/url_request_context_getter.h" | 84 #include "net/url_request/url_request_context_getter.h" |
86 #include "url/gurl.h" | 85 #include "url/gurl.h" |
87 | 86 |
88 using content::BrowserThread; | 87 using content::BrowserThread; |
89 | 88 |
90 namespace chromeos { | 89 namespace chromeos { |
91 | 90 |
92 namespace { | |
93 | |
94 #if defined(ENABLE_RLZ) | |
95 // Flag file that disables RLZ tracking, when present. | |
96 const base::FilePath::CharType kRLZDisabledFlagName[] = | |
97 FILE_PATH_LITERAL(".rlz_disabled"); | |
98 | |
99 base::FilePath GetRlzDisabledFlagPath() { | |
100 base::FilePath homedir; | |
101 PathService::Get(base::DIR_HOME, &homedir); | |
102 return homedir.Append(kRLZDisabledFlagName); | |
103 } | |
104 #endif | |
105 | |
106 } // namespace | |
107 | |
108 struct DoBrowserLaunchOnLocaleLoadedData; | 91 struct DoBrowserLaunchOnLocaleLoadedData; |
109 | 92 |
110 class LoginUtilsImpl | 93 class LoginUtilsImpl |
111 : public LoginUtils, | 94 : public LoginUtils, |
112 public base::SupportsWeakPtr<LoginUtilsImpl>, | 95 public base::SupportsWeakPtr<LoginUtilsImpl>, |
113 public SessionManager::Delegate { | 96 public SessionManager::Delegate { |
114 public: | 97 public: |
115 LoginUtilsImpl() | 98 LoginUtilsImpl() |
116 : delegate_(NULL) { | 99 : delegate_(NULL) { |
117 } | 100 } |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 CrosSettings* cros_settings = CrosSettings::Get(); | 400 CrosSettings* cros_settings = CrosSettings::Get(); |
418 bool allow_new_user = false; | 401 bool allow_new_user = false; |
419 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 402 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
420 if (allow_new_user) | 403 if (allow_new_user) |
421 return true; | 404 return true; |
422 return cros_settings->FindEmailInList( | 405 return cros_settings->FindEmailInList( |
423 kAccountsPrefUsers, username, wildcard_match); | 406 kAccountsPrefUsers, username, wildcard_match); |
424 } | 407 } |
425 | 408 |
426 } // namespace chromeos | 409 } // namespace chromeos |
OLD | NEW |