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