Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 1212163011: Componentize chrome/browser/rlz (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation with gn Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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 RLZTracker::SetRlzDelegate(make_scoped_ptr(new ChromeRLZTrackerDelegate));
1310 profile, 1314 RLZTracker::InitRlzDelayed(
1311 user_manager::UserManager::Get()->IsCurrentUserNew(), 1315 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0,
1312 ping_delay < 0, 1316 base::TimeDelta::FromMilliseconds(abs(ping_delay)),
1313 base::TimeDelta::FromMilliseconds(abs(ping_delay))); 1317 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile),
1318 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile),
1319 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile));
1314 #endif 1320 #endif
1315 } 1321 }
1316 1322
1317 void UserSessionManager::InitializeCerts(Profile* profile) { 1323 void UserSessionManager::InitializeCerts(Profile* profile) {
1318 // Now that the user profile has been initialized 1324 // Now that the user profile has been initialized
1319 // |GetNSSCertDatabaseForProfile| is safe to be used. 1325 // |GetNSSCertDatabaseForProfile| is safe to be used.
1320 if (CertLoader::IsInitialized() && base::SysInfo::IsRunningOnChromeOS()) { 1326 if (CertLoader::IsInitialized() && base::SysInfo::IsRunningOnChromeOS()) {
1321 GetNSSCertDatabaseForProfile(profile, 1327 GetNSSCertDatabaseForProfile(profile,
1322 base::Bind(&OnGetNSSCertDatabaseForUser)); 1328 base::Bind(&OnGetNSSCertDatabaseForUser));
1323 } 1329 }
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 token_handle_util_.reset(); 1729 token_handle_util_.reset();
1724 } 1730 }
1725 1731
1726 void UserSessionManager::CreateTokenUtilIfMissing() { 1732 void UserSessionManager::CreateTokenUtilIfMissing() {
1727 if (!token_handle_util_.get()) 1733 if (!token_handle_util_.get())
1728 token_handle_util_.reset( 1734 token_handle_util_.reset(
1729 new TokenHandleUtil(user_manager::UserManager::Get())); 1735 new TokenHandleUtil(user_manager::UserManager::Get()));
1730 } 1736 }
1731 1737
1732 } // namespace chromeos 1738 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698