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/bind.h" | 12 #include "base/bind.h" |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/file_util.h" | 15 #include "base/file_util.h" |
15 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
16 #include "base/location.h" | 17 #include "base/location.h" |
17 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
18 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
19 #include "base/memory/singleton.h" | 20 #include "base/memory/singleton.h" |
20 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "chrome/browser/pref_service_flags_storage.h" | 59 #include "chrome/browser/pref_service_flags_storage.h" |
59 #include "chrome/browser/profiles/profile.h" | 60 #include "chrome/browser/profiles/profile.h" |
60 #include "chrome/browser/profiles/profile_manager.h" | 61 #include "chrome/browser/profiles/profile_manager.h" |
61 #include "chrome/browser/rlz/rlz.h" | 62 #include "chrome/browser/rlz/rlz.h" |
62 #include "chrome/browser/signin/signin_manager.h" | 63 #include "chrome/browser/signin/signin_manager.h" |
63 #include "chrome/browser/signin/signin_manager_factory.h" | 64 #include "chrome/browser/signin/signin_manager_factory.h" |
64 #include "chrome/browser/sync/profile_sync_service.h" | 65 #include "chrome/browser/sync/profile_sync_service.h" |
65 #include "chrome/browser/sync/profile_sync_service_factory.h" | 66 #include "chrome/browser/sync/profile_sync_service_factory.h" |
66 #include "chrome/browser/ui/app_list/start_page_service.h" | 67 #include "chrome/browser/ui/app_list/start_page_service.h" |
67 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 68 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
68 #include "chrome/common/chrome_paths.h" | |
69 #include "chrome/common/chrome_switches.h" | 69 #include "chrome/common/chrome_switches.h" |
70 #include "chrome/common/logging_chrome.h" | 70 #include "chrome/common/logging_chrome.h" |
71 #include "chrome/common/pref_names.h" | 71 #include "chrome/common/pref_names.h" |
72 #include "chromeos/chromeos_switches.h" | 72 #include "chromeos/chromeos_switches.h" |
73 #include "chromeos/cryptohome/cryptohome_util.h" | 73 #include "chromeos/cryptohome/cryptohome_util.h" |
74 #include "chromeos/dbus/cryptohome_client.h" | 74 #include "chromeos/dbus/cryptohome_client.h" |
75 #include "chromeos/dbus/dbus_method_call_status.h" | 75 #include "chromeos/dbus/dbus_method_call_status.h" |
76 #include "chromeos/dbus/dbus_thread_manager.h" | 76 #include "chromeos/dbus/dbus_thread_manager.h" |
77 #include "chromeos/dbus/session_manager_client.h" | 77 #include "chromeos/dbus/session_manager_client.h" |
78 #include "chromeos/ime/input_method_manager.h" | 78 #include "chromeos/ime/input_method_manager.h" |
(...skipping 11 matching lines...) Expand all Loading... |
90 namespace chromeos { | 90 namespace chromeos { |
91 | 91 |
92 namespace { | 92 namespace { |
93 | 93 |
94 #if defined(ENABLE_RLZ) | 94 #if defined(ENABLE_RLZ) |
95 // Flag file that disables RLZ tracking, when present. | 95 // Flag file that disables RLZ tracking, when present. |
96 const base::FilePath::CharType kRLZDisabledFlagName[] = | 96 const base::FilePath::CharType kRLZDisabledFlagName[] = |
97 FILE_PATH_LITERAL(".rlz_disabled"); | 97 FILE_PATH_LITERAL(".rlz_disabled"); |
98 | 98 |
99 base::FilePath GetRlzDisabledFlagPath() { | 99 base::FilePath GetRlzDisabledFlagPath() { |
100 return base::GetHomeDir().Append(kRLZDisabledFlagName); | 100 base::FilePath homedir; |
| 101 PathService::Get(base::DIR_HOME, &homedir); |
| 102 return homedir.Append(kRLZDisabledFlagName); |
101 } | 103 } |
102 #endif | 104 #endif |
103 | 105 |
104 } // namespace | 106 } // namespace |
105 | 107 |
106 struct DoBrowserLaunchOnLocaleLoadedData; | 108 struct DoBrowserLaunchOnLocaleLoadedData; |
107 | 109 |
108 class LoginUtilsImpl | 110 class LoginUtilsImpl |
109 : public LoginUtils, | 111 : public LoginUtils, |
110 public OAuth2LoginManager::Observer, | 112 public OAuth2LoginManager::Observer, |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 CrosSettings* cros_settings = CrosSettings::Get(); | 947 CrosSettings* cros_settings = CrosSettings::Get(); |
946 bool allow_new_user = false; | 948 bool allow_new_user = false; |
947 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 949 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
948 if (allow_new_user) | 950 if (allow_new_user) |
949 return true; | 951 return true; |
950 return cros_settings->FindEmailInList( | 952 return cros_settings->FindEmailInList( |
951 kAccountsPrefUsers, username, wildcard_match); | 953 kAccountsPrefUsers, username, wildcard_match); |
952 } | 954 } |
953 | 955 |
954 } // namespace chromeos | 956 } // namespace chromeos |
OLD | NEW |