| 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 #ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ | 6 #define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
| 11 #include "chrome/browser/browser_process_platform_part_base.h" | 11 #include "chrome/browser/browser_process_platform_part_base.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class CommandLine; | 14 class CommandLine; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace chromeos { |
| 18 class ChromeUserManager; | 18 class ChromeUserManager; |
| 19 class OomPriorityManager; | 19 class OomPriorityManager; |
| 20 class ProfileHelper; | 20 class ProfileHelper; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace chromeos { | 23 namespace chromeos { |
| 24 namespace system { | 24 namespace system { |
| 25 class AutomaticRebootManager; | 25 class AutomaticRebootManager; |
| 26 class DeviceDisablingManager; |
| 26 } | 27 } |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace policy { | 30 namespace policy { |
| 30 class BrowserPolicyConnector; | 31 class BrowserPolicyConnector; |
| 31 class BrowserPolicyConnectorChromeOS; | 32 class BrowserPolicyConnectorChromeOS; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace session_manager { | 35 namespace session_manager { |
| 35 class SessionManager; | 36 class SessionManager; |
| 36 } | 37 } |
| 37 | 38 |
| 38 class Profile; | 39 class Profile; |
| 39 | 40 |
| 40 class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase, | 41 class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase, |
| 41 public base::NonThreadSafe { | 42 public base::NonThreadSafe { |
| 42 public: | 43 public: |
| 43 BrowserProcessPlatformPart(); | 44 BrowserProcessPlatformPart(); |
| 44 virtual ~BrowserProcessPlatformPart(); | 45 virtual ~BrowserProcessPlatformPart(); |
| 45 | 46 |
| 46 void InitializeAutomaticRebootManager(); | 47 void InitializeAutomaticRebootManager(); |
| 47 void ShutdownAutomaticRebootManager(); | 48 void ShutdownAutomaticRebootManager(); |
| 48 | 49 |
| 49 void InitializeChromeUserManager(); | 50 void InitializeChromeUserManager(); |
| 50 void DestroyChromeUserManager(); | 51 void DestroyChromeUserManager(); |
| 51 | 52 |
| 53 void InitializeDeviceDisablingManager(); |
| 54 void ShutdownDeviceDisablingManager(); |
| 55 |
| 52 void InitializeSessionManager(const base::CommandLine& parsed_command_line, | 56 void InitializeSessionManager(const base::CommandLine& parsed_command_line, |
| 53 Profile* profile, | 57 Profile* profile, |
| 54 bool is_running_test); | 58 bool is_running_test); |
| 55 void ShutdownSessionManager(); | 59 void ShutdownSessionManager(); |
| 56 | 60 |
| 57 // Returns the SessionManager instance that is used to initialize and | 61 // Returns the SessionManager instance that is used to initialize and |
| 58 // start user sessions as well as responsible on launching pre-session UI like | 62 // start user sessions as well as responsible on launching pre-session UI like |
| 59 // out-of-box or login. | 63 // out-of-box or login. |
| 60 virtual session_manager::SessionManager* SessionManager(); | 64 virtual session_manager::SessionManager* SessionManager(); |
| 61 | 65 |
| 62 // Returns the out-of-memory priority manager. | 66 // Returns the out-of-memory priority manager. |
| 63 // Virtual for testing (see TestingBrowserProcessPlatformPart). | 67 // Virtual for testing (see TestingBrowserProcessPlatformPart). |
| 64 virtual chromeos::OomPriorityManager* oom_priority_manager(); | 68 virtual chromeos::OomPriorityManager* oom_priority_manager(); |
| 65 | 69 |
| 66 // Returns the ProfileHelper instance that is used to identify | 70 // Returns the ProfileHelper instance that is used to identify |
| 67 // users and their profiles in Chrome OS multi user session. | 71 // users and their profiles in Chrome OS multi user session. |
| 68 chromeos::ProfileHelper* profile_helper(); | 72 chromeos::ProfileHelper* profile_helper(); |
| 69 | 73 |
| 70 chromeos::system::AutomaticRebootManager* automatic_reboot_manager() { | 74 chromeos::system::AutomaticRebootManager* automatic_reboot_manager() { |
| 71 return automatic_reboot_manager_.get(); | 75 return automatic_reboot_manager_.get(); |
| 72 } | 76 } |
| 73 | 77 |
| 74 policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_chromeos(); | 78 policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_chromeos(); |
| 75 | 79 |
| 76 chromeos::ChromeUserManager* user_manager() { | 80 chromeos::ChromeUserManager* user_manager() { |
| 77 return chrome_user_manager_.get(); | 81 return chrome_user_manager_.get(); |
| 78 } | 82 } |
| 79 | 83 |
| 84 chromeos::system::DeviceDisablingManager* device_disabling_manager() { |
| 85 return device_disabling_manager_.get(); |
| 86 } |
| 87 |
| 80 // Overridden from BrowserProcessPlatformPartBase: | 88 // Overridden from BrowserProcessPlatformPartBase: |
| 81 virtual void StartTearDown() override; | 89 virtual void StartTearDown() override; |
| 82 | 90 |
| 83 virtual scoped_ptr<policy::BrowserPolicyConnector> | 91 virtual scoped_ptr<policy::BrowserPolicyConnector> |
| 84 CreateBrowserPolicyConnector() override; | 92 CreateBrowserPolicyConnector() override; |
| 85 | 93 |
| 86 private: | 94 private: |
| 87 void CreateProfileHelper(); | 95 void CreateProfileHelper(); |
| 88 | 96 |
| 89 scoped_ptr<session_manager::SessionManager> session_manager_; | 97 scoped_ptr<session_manager::SessionManager> session_manager_; |
| 90 | 98 |
| 91 bool created_profile_helper_; | 99 bool created_profile_helper_; |
| 92 scoped_ptr<chromeos::ProfileHelper> profile_helper_; | 100 scoped_ptr<chromeos::ProfileHelper> profile_helper_; |
| 93 | 101 |
| 94 scoped_ptr<chromeos::OomPriorityManager> oom_priority_manager_; | 102 scoped_ptr<chromeos::OomPriorityManager> oom_priority_manager_; |
| 95 | 103 |
| 96 scoped_ptr<chromeos::system::AutomaticRebootManager> | 104 scoped_ptr<chromeos::system::AutomaticRebootManager> |
| 97 automatic_reboot_manager_; | 105 automatic_reboot_manager_; |
| 98 | 106 |
| 99 scoped_ptr<chromeos::ChromeUserManager> chrome_user_manager_; | 107 scoped_ptr<chromeos::ChromeUserManager> chrome_user_manager_; |
| 100 | 108 |
| 109 scoped_ptr<chromeos::system::DeviceDisablingManager> |
| 110 device_disabling_manager_; |
| 111 |
| 101 DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart); | 112 DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart); |
| 102 }; | 113 }; |
| 103 | 114 |
| 104 #endif // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ | 115 #endif // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ |
| OLD | NEW |