| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/base_paths.h" | 13 #include "base/base_paths.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/ptr_util.h" |
| 17 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 18 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 20 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 21 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 22 #include "base/sys_info.h" | 23 #include "base/sys_info.h" |
| 23 #include "base/task_runner_util.h" | 24 #include "base/task_runner_util.h" |
| 24 #include "base/thread_task_runner_handle.h" | 25 #include "base/thread_task_runner_handle.h" |
| 25 #include "base/threading/worker_pool.h" | 26 #include "base/threading/worker_pool.h" |
| 26 #include "chrome/browser/about_flags.h" | 27 #include "chrome/browser/about_flags.h" |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 // When switching to RLZ enabled/disabled state, clear all recorded events. | 1376 // When switching to RLZ enabled/disabled state, clear all recorded events. |
| 1376 rlz::RLZTracker::ClearRlzState(); | 1377 rlz::RLZTracker::ClearRlzState(); |
| 1377 local_state->SetBoolean(prefs::kRLZDisabled, disabled); | 1378 local_state->SetBoolean(prefs::kRLZDisabled, disabled); |
| 1378 } | 1379 } |
| 1379 // Init the RLZ library. | 1380 // Init the RLZ library. |
| 1380 int ping_delay = profile->GetPrefs()->GetInteger( | 1381 int ping_delay = profile->GetPrefs()->GetInteger( |
| 1381 ::first_run::GetPingDelayPrefName().c_str()); | 1382 ::first_run::GetPingDelayPrefName().c_str()); |
| 1382 // Negative ping delay means to send ping immediately after a first search is | 1383 // Negative ping delay means to send ping immediately after a first search is |
| 1383 // recorded. | 1384 // recorded. |
| 1384 rlz::RLZTracker::SetRlzDelegate( | 1385 rlz::RLZTracker::SetRlzDelegate( |
| 1385 make_scoped_ptr(new ChromeRLZTrackerDelegate)); | 1386 base::WrapUnique(new ChromeRLZTrackerDelegate)); |
| 1386 rlz::RLZTracker::InitRlzDelayed( | 1387 rlz::RLZTracker::InitRlzDelayed( |
| 1387 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, | 1388 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, |
| 1388 base::TimeDelta::FromMilliseconds(abs(ping_delay)), | 1389 base::TimeDelta::FromMilliseconds(abs(ping_delay)), |
| 1389 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile), | 1390 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile), |
| 1390 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile), | 1391 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile), |
| 1391 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile)); | 1392 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile)); |
| 1392 #endif | 1393 #endif |
| 1393 } | 1394 } |
| 1394 | 1395 |
| 1395 void UserSessionManager::InitializeCerts(Profile* profile) { | 1396 void UserSessionManager::InitializeCerts(Profile* profile) { |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 token_handle_util_.reset(); | 1813 token_handle_util_.reset(); |
| 1813 first_run::GoodiesDisplayer::Delete(); | 1814 first_run::GoodiesDisplayer::Delete(); |
| 1814 } | 1815 } |
| 1815 | 1816 |
| 1816 void UserSessionManager::CreateTokenUtilIfMissing() { | 1817 void UserSessionManager::CreateTokenUtilIfMissing() { |
| 1817 if (!token_handle_util_.get()) | 1818 if (!token_handle_util_.get()) |
| 1818 token_handle_util_.reset(new TokenHandleUtil()); | 1819 token_handle_util_.reset(new TokenHandleUtil()); |
| 1819 } | 1820 } |
| 1820 | 1821 |
| 1821 } // namespace chromeos | 1822 } // namespace chromeos |
| OLD | NEW |