| 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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 // When switching to RLZ enabled/disabled state, clear all recorded events. | 1378 // When switching to RLZ enabled/disabled state, clear all recorded events. |
| 1378 rlz::RLZTracker::ClearRlzState(); | 1379 rlz::RLZTracker::ClearRlzState(); |
| 1379 local_state->SetBoolean(prefs::kRLZDisabled, disabled); | 1380 local_state->SetBoolean(prefs::kRLZDisabled, disabled); |
| 1380 } | 1381 } |
| 1381 // Init the RLZ library. | 1382 // Init the RLZ library. |
| 1382 int ping_delay = profile->GetPrefs()->GetInteger( | 1383 int ping_delay = profile->GetPrefs()->GetInteger( |
| 1383 ::first_run::GetPingDelayPrefName().c_str()); | 1384 ::first_run::GetPingDelayPrefName().c_str()); |
| 1384 // Negative ping delay means to send ping immediately after a first search is | 1385 // Negative ping delay means to send ping immediately after a first search is |
| 1385 // recorded. | 1386 // recorded. |
| 1386 rlz::RLZTracker::SetRlzDelegate( | 1387 rlz::RLZTracker::SetRlzDelegate( |
| 1387 make_scoped_ptr(new ChromeRLZTrackerDelegate)); | 1388 base::WrapUnique(new ChromeRLZTrackerDelegate)); |
| 1388 rlz::RLZTracker::InitRlzDelayed( | 1389 rlz::RLZTracker::InitRlzDelayed( |
| 1389 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, | 1390 user_manager::UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, |
| 1390 base::TimeDelta::FromMilliseconds(abs(ping_delay)), | 1391 base::TimeDelta::FromMilliseconds(abs(ping_delay)), |
| 1391 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile), | 1392 ChromeRLZTrackerDelegate::IsGoogleDefaultSearch(profile), |
| 1392 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile), | 1393 ChromeRLZTrackerDelegate::IsGoogleHomepage(profile), |
| 1393 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile)); | 1394 ChromeRLZTrackerDelegate::IsGoogleInStartpages(profile)); |
| 1394 #endif | 1395 #endif |
| 1395 } | 1396 } |
| 1396 | 1397 |
| 1397 void UserSessionManager::InitializeCerts(Profile* profile) { | 1398 void UserSessionManager::InitializeCerts(Profile* profile) { |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 token_handle_util_.reset(); | 1818 token_handle_util_.reset(); |
| 1818 first_run::GoodiesDisplayer::Delete(); | 1819 first_run::GoodiesDisplayer::Delete(); |
| 1819 } | 1820 } |
| 1820 | 1821 |
| 1821 void UserSessionManager::CreateTokenUtilIfMissing() { | 1822 void UserSessionManager::CreateTokenUtilIfMissing() { |
| 1822 if (!token_handle_util_.get()) | 1823 if (!token_handle_util_.get()) |
| 1823 token_handle_util_.reset(new TokenHandleUtil()); | 1824 token_handle_util_.reset(new TokenHandleUtil()); |
| 1824 } | 1825 } |
| 1825 | 1826 |
| 1826 } // namespace chromeos | 1827 } // namespace chromeos |
| OLD | NEW |