summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_platform_part_chromeos.h
blob: 311a7c8df3056cf2ea8f513377952a88ca509478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_
#define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_

#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/browser_process_platform_part_base.h"

namespace base {
class CommandLine;
}

namespace chromeos {
class ChromeUserManager;
class OomPriorityManager;
class ProfileHelper;
}

namespace chromeos {
namespace system {
class AutomaticRebootManager;
class DeviceDisablingManager;
class DeviceDisablingManagerDefaultDelegate;
}
}

namespace policy {
class BrowserPolicyConnector;
class BrowserPolicyConnectorChromeOS;
}

namespace session_manager {
class SessionManager;
}

class Profile;

class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase,
                                   public base::NonThreadSafe {
 public:
  BrowserProcessPlatformPart();
  virtual ~BrowserProcessPlatformPart();

  void InitializeAutomaticRebootManager();
  void ShutdownAutomaticRebootManager();

  void InitializeChromeUserManager();
  void DestroyChromeUserManager();

  void InitializeDeviceDisablingManager();
  void ShutdownDeviceDisablingManager();

  void InitializeSessionManager(const base::CommandLine& parsed_command_line,
                                Profile* profile,
                                bool is_running_test);
  void ShutdownSessionManager();

  // Returns the SessionManager instance that is used to initialize and
  // start user sessions as well as responsible on launching pre-session UI like
  // out-of-box or login.
  virtual session_manager::SessionManager* SessionManager();

  // Returns the out-of-memory priority manager.
  // Virtual for testing (see TestingBrowserProcessPlatformPart).
  virtual chromeos::OomPriorityManager* oom_priority_manager();

  // Returns the ProfileHelper instance that is used to identify
  // users and their profiles in Chrome OS multi user session.
  chromeos::ProfileHelper* profile_helper();

  chromeos::system::AutomaticRebootManager* automatic_reboot_manager() {
    return automatic_reboot_manager_.get();
  }

  policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_chromeos();

  chromeos::ChromeUserManager* user_manager() {
    return chrome_user_manager_.get();
  }

  chromeos::system::DeviceDisablingManager* device_disabling_manager() {
    return device_disabling_manager_.get();
  }

  // Overridden from BrowserProcessPlatformPartBase:
  virtual void StartTearDown() override;

  virtual scoped_ptr<policy::BrowserPolicyConnector>
      CreateBrowserPolicyConnector() override;

 private:
  void CreateProfileHelper();

  scoped_ptr<session_manager::SessionManager> session_manager_;

  bool created_profile_helper_;
  scoped_ptr<chromeos::ProfileHelper> profile_helper_;

  scoped_ptr<chromeos::OomPriorityManager> oom_priority_manager_;

  scoped_ptr<chromeos::system::AutomaticRebootManager>
      automatic_reboot_manager_;

  scoped_ptr<chromeos::ChromeUserManager> chrome_user_manager_;

  scoped_ptr<chromeos::system::DeviceDisablingManagerDefaultDelegate>
      device_disabling_manager_delegate_;
  scoped_ptr<chromeos::system::DeviceDisablingManager>
      device_disabling_manager_;

  DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart);
};

#endif  // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_