| 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/location.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 18 #include "base/message_loop/message_loop.h" | |
| 19 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/single_thread_task_runner.h" |
| 21 #include "base/strings/string16.h" | 22 #include "base/strings/string16.h" |
| 22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 23 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
| 24 #include "base/task_runner_util.h" | 25 #include "base/task_runner_util.h" |
| 25 #include "base/threading/thread_task_runner_handle.h" | 26 #include "base/threading/thread_task_runner_handle.h" |
| 26 #include "base/threading/worker_pool.h" | 27 #include "base/threading/worker_pool.h" |
| 27 #include "chrome/browser/about_flags.h" | 28 #include "chrome/browser/about_flags.h" |
| 28 #include "chrome/browser/app_mode/app_mode_utils.h" | 29 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 29 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
| 30 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 31 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| (...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 auth_request_context = | 1577 auth_request_context = |
| 1577 content::BrowserContext::GetDefaultStoragePartition( | 1578 content::BrowserContext::GetDefaultStoragePartition( |
| 1578 authenticator_->authentication_context())->GetURLRequestContext(); | 1579 authenticator_->authentication_context())->GetURLRequestContext(); |
| 1579 } | 1580 } |
| 1580 return auth_request_context; | 1581 return auth_request_context; |
| 1581 } | 1582 } |
| 1582 | 1583 |
| 1583 void UserSessionManager::AttemptRestart(Profile* profile) { | 1584 void UserSessionManager::AttemptRestart(Profile* profile) { |
| 1584 // Restart unconditionally in case if we are stuck somewhere in a session | 1585 // Restart unconditionally in case if we are stuck somewhere in a session |
| 1585 // restore process. http://crbug.com/520346. | 1586 // restore process. http://crbug.com/520346. |
| 1586 base::MessageLoop::current()->PostDelayedTask( | 1587 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 1587 FROM_HERE, base::Bind(RestartOnTimeout), | 1588 FROM_HERE, base::Bind(RestartOnTimeout), |
| 1588 base::TimeDelta::FromSeconds(kMaxRestartDelaySeconds)); | 1589 base::TimeDelta::FromSeconds(kMaxRestartDelaySeconds)); |
| 1589 | 1590 |
| 1590 if (CheckEasyUnlockKeyOps(base::Bind(&UserSessionManager::AttemptRestart, | 1591 if (CheckEasyUnlockKeyOps(base::Bind(&UserSessionManager::AttemptRestart, |
| 1591 AsWeakPtr(), profile))) { | 1592 AsWeakPtr(), profile))) { |
| 1592 return; | 1593 return; |
| 1593 } | 1594 } |
| 1594 | 1595 |
| 1595 if (session_restore_strategy_ != | 1596 if (session_restore_strategy_ != |
| 1596 OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { | 1597 OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 token_handle_util_.reset(); | 1832 token_handle_util_.reset(); |
| 1832 first_run::GoodiesDisplayer::Delete(); | 1833 first_run::GoodiesDisplayer::Delete(); |
| 1833 } | 1834 } |
| 1834 | 1835 |
| 1835 void UserSessionManager::CreateTokenUtilIfMissing() { | 1836 void UserSessionManager::CreateTokenUtilIfMissing() { |
| 1836 if (!token_handle_util_.get()) | 1837 if (!token_handle_util_.get()) |
| 1837 token_handle_util_.reset(new TokenHandleUtil()); | 1838 token_handle_util_.reset(new TokenHandleUtil()); |
| 1838 } | 1839 } |
| 1839 | 1840 |
| 1840 } // namespace chromeos | 1841 } // namespace chromeos |
| OLD | NEW |