OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_process_platform_part_chromeos.h" | 5 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
10 #include "base/time/tick_clock.h" | 10 #include "base/time/tick_clock.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" | 12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
| 13 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
13 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 14 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
14 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
16 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" | 17 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "components/session_manager/core/session_manager.h" | 19 #include "components/session_manager/core/session_manager.h" |
19 | 20 |
20 BrowserProcessPlatformPart::BrowserProcessPlatformPart() | 21 BrowserProcessPlatformPart::BrowserProcessPlatformPart() |
21 : created_profile_helper_(false) { | 22 : created_profile_helper_(false) { |
22 } | 23 } |
23 | 24 |
24 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { | 25 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { |
25 } | 26 } |
26 | 27 |
27 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { | 28 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { |
28 DCHECK(!automatic_reboot_manager_); | 29 DCHECK(!automatic_reboot_manager_); |
29 | 30 |
30 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( | 31 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( |
31 scoped_ptr<base::TickClock>(new base::DefaultTickClock))); | 32 scoped_ptr<base::TickClock>(new base::DefaultTickClock))); |
32 } | 33 } |
33 | 34 |
34 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { | 35 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { |
35 automatic_reboot_manager_.reset(); | 36 automatic_reboot_manager_.reset(); |
36 } | 37 } |
37 | 38 |
| 39 void BrowserProcessPlatformPart::InitializeChromeUserManager() { |
| 40 DCHECK(!chrome_user_manager_); |
| 41 chrome_user_manager_ = |
| 42 chromeos::ChromeUserManagerImpl::CreateChromeUserManager(); |
| 43 chrome_user_manager_->Initialize(); |
| 44 } |
| 45 |
| 46 void BrowserProcessPlatformPart::DestroyChromeUserManager() { |
| 47 chrome_user_manager_->Destroy(); |
| 48 chrome_user_manager_.reset(); |
| 49 } |
| 50 |
38 void BrowserProcessPlatformPart::InitializeSessionManager( | 51 void BrowserProcessPlatformPart::InitializeSessionManager( |
39 const base::CommandLine& parsed_command_line, | 52 const base::CommandLine& parsed_command_line, |
40 Profile* profile, | 53 Profile* profile, |
41 bool is_running_test) { | 54 bool is_running_test) { |
42 DCHECK(!session_manager_); | 55 DCHECK(!session_manager_); |
43 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager( | 56 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager( |
44 parsed_command_line, profile, is_running_test); | 57 parsed_command_line, profile, is_running_test); |
45 } | 58 } |
46 | 59 |
47 void BrowserProcessPlatformPart::ShutdownSessionManager() { | 60 void BrowserProcessPlatformPart::ShutdownSessionManager() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { | 95 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { |
83 return scoped_ptr<policy::BrowserPolicyConnector>( | 96 return scoped_ptr<policy::BrowserPolicyConnector>( |
84 new policy::BrowserPolicyConnectorChromeOS()); | 97 new policy::BrowserPolicyConnectorChromeOS()); |
85 } | 98 } |
86 | 99 |
87 void BrowserProcessPlatformPart::CreateProfileHelper() { | 100 void BrowserProcessPlatformPart::CreateProfileHelper() { |
88 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); | 101 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); |
89 created_profile_helper_ = true; | 102 created_profile_helper_ = true; |
90 profile_helper_.reset(new chromeos::ProfileHelper()); | 103 profile_helper_.reset(new chromeos::ProfileHelper()); |
91 } | 104 } |
OLD | NEW |