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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 58 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
59 #include "chrome/browser/first_run/first_run.h" | 59 #include "chrome/browser/first_run/first_run.h" |
60 #include "chrome/browser/google/google_brand_chromeos.h" | 60 #include "chrome/browser/google/google_brand_chromeos.h" |
61 #include "chrome/browser/lifetime/application_lifetime.h" | 61 #include "chrome/browser/lifetime/application_lifetime.h" |
62 #include "chrome/browser/net/crl_set_fetcher.h" | 62 #include "chrome/browser/net/crl_set_fetcher.h" |
63 #include "chrome/browser/net/nss_context.h" | 63 #include "chrome/browser/net/nss_context.h" |
64 #include "chrome/browser/pref_service_flags_storage.h" | 64 #include "chrome/browser/pref_service_flags_storage.h" |
65 #include "chrome/browser/prefs/session_startup_pref.h" | 65 #include "chrome/browser/prefs/session_startup_pref.h" |
66 #include "chrome/browser/profiles/profile.h" | 66 #include "chrome/browser/profiles/profile.h" |
67 #include "chrome/browser/profiles/profile_manager.h" | 67 #include "chrome/browser/profiles/profile_manager.h" |
| 68 #include "chrome/browser/rlz/rlz.h" |
68 #include "chrome/browser/signin/account_tracker_service_factory.h" | 69 #include "chrome/browser/signin/account_tracker_service_factory.h" |
69 #include "chrome/browser/signin/easy_unlock_service.h" | 70 #include "chrome/browser/signin/easy_unlock_service.h" |
70 #include "chrome/browser/signin/signin_manager_factory.h" | 71 #include "chrome/browser/signin/signin_manager_factory.h" |
71 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" | 72 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
72 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" | 73 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" |
73 #include "chrome/browser/ui/app_list/start_page_service.h" | 74 #include "chrome/browser/ui/app_list/start_page_service.h" |
74 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 75 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
75 #include "chrome/common/chrome_switches.h" | 76 #include "chrome/common/chrome_switches.h" |
76 #include "chrome/common/logging_chrome.h" | 77 #include "chrome/common/logging_chrome.h" |
77 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
(...skipping 15 matching lines...) Expand all Loading... |
93 #include "components/signin/core/browser/signin_manager_base.h" | 94 #include "components/signin/core/browser/signin_manager_base.h" |
94 #include "components/user_manager/user.h" | 95 #include "components/user_manager/user.h" |
95 #include "components/user_manager/user_manager.h" | 96 #include "components/user_manager/user_manager.h" |
96 #include "components/user_manager/user_type.h" | 97 #include "components/user_manager/user_type.h" |
97 #include "content/public/browser/browser_thread.h" | 98 #include "content/public/browser/browser_thread.h" |
98 #include "content/public/browser/notification_service.h" | 99 #include "content/public/browser/notification_service.h" |
99 #include "content/public/browser/storage_partition.h" | 100 #include "content/public/browser/storage_partition.h" |
100 #include "ui/base/ime/chromeos/input_method_manager.h" | 101 #include "ui/base/ime/chromeos/input_method_manager.h" |
101 #include "url/gurl.h" | 102 #include "url/gurl.h" |
102 | 103 |
103 #if defined(ENABLE_RLZ) | |
104 #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h" | |
105 #include "components/rlz/rlz_tracker.h" | |
106 #endif | |
107 | |
108 namespace chromeos { | 104 namespace chromeos { |
109 | 105 |
110 namespace { | 106 namespace { |
111 | 107 |
112 // Milliseconds until we timeout our attempt to fetch flags from the child | 108 // Milliseconds until we timeout our attempt to fetch flags from the child |
113 // account service. | 109 // account service. |
114 static const int kFlagsFetchingLoginTimeoutMs = 1000; | 110 static const int kFlagsFetchingLoginTimeoutMs = 1000; |
115 | 111 |
116 // ChromeVox tutorial URL (used in place of "getting started" url when | 112 // ChromeVox tutorial URL (used in place of "getting started" url when |
117 // accessibility is enabled). | 113 // accessibility is enabled). |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 | 1291 |
1296 void UserSessionManager::InitRlzImpl(Profile* profile, bool disabled) { | 1292 void UserSessionManager::InitRlzImpl(Profile* profile, bool disabled) { |
1297 #if defined(ENABLE_RLZ) | 1293 #if defined(ENABLE_RLZ) |
1298 PrefService* local_state = g_browser_process->local_state(); | 1294 PrefService* local_state = g_browser_process->local_state(); |
1299 if (disabled) { | 1295 if (disabled) { |
1300 // Empty brand code means an organic install (no RLZ pings are sent). | 1296 // Empty brand code means an organic install (no RLZ pings are sent). |
1301 google_brand::chromeos::ClearBrandForCurrentSession(); | 1297 google_brand::chromeos::ClearBrandForCurrentSession(); |
1302 } | 1298 } |
1303 if (disabled != local_state->GetBoolean(prefs::kRLZDisabled)) { | 1299 if (disabled != local_state->GetBoolean(prefs::kRLZDisabled)) { |
1304 // When switching to RLZ enabled/disabled state, clear all recorded events. | 1300 // When switching to RLZ enabled/disabled state, clear all recorded events. |
1305 rlz::RLZTracker::ClearRlzState(); | 1301 RLZTracker::ClearRlzState(); |
1306 local_state->SetBoolean(prefs::kRLZDisabled, disabled); | 1302 local_state->SetBoolean(prefs::kRLZDisabled, disabled); |
1307 } | 1303 } |
1308 // Init the RLZ library. | 1304 // Init the RLZ library. |
1309 int ping_delay = profile->GetPrefs()->GetInteger( | 1305 int ping_delay = profile->GetPrefs()->GetInteger( |
1310 ::first_run::GetPingDelayPrefName().c_str()); | 1306 ::first_run::GetPingDelayPrefName().c_str()); |
1311 // Negative ping delay means to send ping immediately after a first search is | 1307 // Negative ping delay means to send ping immediately after a first search is |
1312 // recorded. | 1308 // recorded. |
1313 rlz::RLZTracker::SetRlzDelegate( | 1309 RLZTracker::InitRlzFromProfileDelayed( |
1314 make_scoped_ptr(new ChromeRLZTrackerDelegate)); | 1310 profile, |
1315 rlz::RLZTracker::InitRlzDelayed( | 1311 user_manager::UserManager::Get()->IsCurrentUserNew(), |
1316 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, | 1312 ping_delay < 0, |
1317 base::TimeDelta::FromMilliseconds(abs(ping_delay)), | 1313 base::TimeDelta::FromMilliseconds(abs(ping_delay))); |
1318 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile), | |
1319 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile), | |
1320 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile)); | |
1321 #endif | 1314 #endif |
1322 } | 1315 } |
1323 | 1316 |
1324 void UserSessionManager::InitializeCerts(Profile* profile) { | 1317 void UserSessionManager::InitializeCerts(Profile* profile) { |
1325 // Now that the user profile has been initialized | 1318 // Now that the user profile has been initialized |
1326 // |GetNSSCertDatabaseForProfile| is safe to be used. | 1319 // |GetNSSCertDatabaseForProfile| is safe to be used. |
1327 if (CertLoader::IsInitialized() && base::SysInfo::IsRunningOnChromeOS()) { | 1320 if (CertLoader::IsInitialized() && base::SysInfo::IsRunningOnChromeOS()) { |
1328 GetNSSCertDatabaseForProfile(profile, | 1321 GetNSSCertDatabaseForProfile(profile, |
1329 base::Bind(&OnGetNSSCertDatabaseForUser)); | 1322 base::Bind(&OnGetNSSCertDatabaseForUser)); |
1330 } | 1323 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 token_handle_util_.reset(); | 1723 token_handle_util_.reset(); |
1731 } | 1724 } |
1732 | 1725 |
1733 void UserSessionManager::CreateTokenUtilIfMissing() { | 1726 void UserSessionManager::CreateTokenUtilIfMissing() { |
1734 if (!token_handle_util_.get()) | 1727 if (!token_handle_util_.get()) |
1735 token_handle_util_.reset( | 1728 token_handle_util_.reset( |
1736 new TokenHandleUtil(user_manager::UserManager::Get())); | 1729 new TokenHandleUtil(user_manager::UserManager::Get())); |
1737 } | 1730 } |
1738 | 1731 |
1739 } // namespace chromeos | 1732 } // namespace chromeos |
OLD | NEW |