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/login/users/chrome_user_manager_impl.h" |
14 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 14 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" |
15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 15 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 17 #include "chrome/browser/chromeos/settings/cros_settings.h" |
17 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" | 18 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" |
18 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 19 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
| 20 #include "chrome/browser/chromeos/system/device_disabling_manager_default_delega
te.h" |
19 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
20 #include "components/session_manager/core/session_manager.h" | 22 #include "components/session_manager/core/session_manager.h" |
| 23 #include "components/user_manager/user_manager.h" |
21 | 24 |
22 BrowserProcessPlatformPart::BrowserProcessPlatformPart() | 25 BrowserProcessPlatformPart::BrowserProcessPlatformPart() |
23 : created_profile_helper_(false) { | 26 : created_profile_helper_(false) { |
24 } | 27 } |
25 | 28 |
26 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { | 29 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { |
27 } | 30 } |
28 | 31 |
29 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { | 32 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { |
30 DCHECK(!automatic_reboot_manager_); | 33 DCHECK(!automatic_reboot_manager_); |
(...skipping 14 matching lines...) Expand all Loading... |
45 } | 48 } |
46 | 49 |
47 void BrowserProcessPlatformPart::DestroyChromeUserManager() { | 50 void BrowserProcessPlatformPart::DestroyChromeUserManager() { |
48 chrome_user_manager_->Destroy(); | 51 chrome_user_manager_->Destroy(); |
49 chrome_user_manager_.reset(); | 52 chrome_user_manager_.reset(); |
50 } | 53 } |
51 | 54 |
52 void BrowserProcessPlatformPart::InitializeDeviceDisablingManager() { | 55 void BrowserProcessPlatformPart::InitializeDeviceDisablingManager() { |
53 DCHECK(!device_disabling_manager_); | 56 DCHECK(!device_disabling_manager_); |
54 | 57 |
| 58 device_disabling_manager_delegate_.reset( |
| 59 new chromeos::system::DeviceDisablingManagerDefaultDelegate); |
55 device_disabling_manager_.reset(new chromeos::system::DeviceDisablingManager( | 60 device_disabling_manager_.reset(new chromeos::system::DeviceDisablingManager( |
56 browser_policy_connector_chromeos())); | 61 device_disabling_manager_delegate_.get(), |
| 62 chromeos::CrosSettings::Get(), |
| 63 user_manager::UserManager::Get())); |
57 } | 64 } |
58 | 65 |
59 void BrowserProcessPlatformPart::ShutdownDeviceDisablingManager() { | 66 void BrowserProcessPlatformPart::ShutdownDeviceDisablingManager() { |
60 device_disabling_manager_.reset(); | 67 device_disabling_manager_.reset(); |
| 68 device_disabling_manager_delegate_.reset(); |
61 } | 69 } |
62 | 70 |
63 void BrowserProcessPlatformPart::InitializeSessionManager( | 71 void BrowserProcessPlatformPart::InitializeSessionManager( |
64 const base::CommandLine& parsed_command_line, | 72 const base::CommandLine& parsed_command_line, |
65 Profile* profile, | 73 Profile* profile, |
66 bool is_running_test) { | 74 bool is_running_test) { |
67 DCHECK(!session_manager_); | 75 DCHECK(!session_manager_); |
68 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager( | 76 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager( |
69 parsed_command_line, profile, is_running_test); | 77 parsed_command_line, profile, is_running_test); |
70 } | 78 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { | 115 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { |
108 return scoped_ptr<policy::BrowserPolicyConnector>( | 116 return scoped_ptr<policy::BrowserPolicyConnector>( |
109 new policy::BrowserPolicyConnectorChromeOS()); | 117 new policy::BrowserPolicyConnectorChromeOS()); |
110 } | 118 } |
111 | 119 |
112 void BrowserProcessPlatformPart::CreateProfileHelper() { | 120 void BrowserProcessPlatformPart::CreateProfileHelper() { |
113 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); | 121 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); |
114 created_profile_helper_ = true; | 122 created_profile_helper_ = true; |
115 profile_helper_.reset(new chromeos::ProfileHelper()); | 123 profile_helper_.reset(new chromeos::ProfileHelper()); |
116 } | 124 } |
OLD | NEW |