Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: chrome/browser/browser_process_platform_part_chromeos.cc

Issue 363613004: [cros] Define session_manager component with SessionManager base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: default to RestoreAfterCrashSessionManagerDelegate Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/logging.h" 8 #include "base/logging.h"
8 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
9 #include "base/time/tick_clock.h" 10 #include "base/time/tick_clock.h"
10 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
11 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" 13 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
12 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 14 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
13 #include "chrome/browser/chromeos/profiles/profile_helper.h" 15 #include "chrome/browser/chromeos/profiles/profile_helper.h"
14 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" 16 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
17 #include "chrome/browser/profiles/profile.h"
18 #include "components/session_manager/core/session_manager.h"
15 19
16 BrowserProcessPlatformPart::BrowserProcessPlatformPart() 20 BrowserProcessPlatformPart::BrowserProcessPlatformPart()
17 : created_profile_helper_(false) { 21 : created_profile_helper_(false) {
18 } 22 }
19 23
20 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { 24 BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {
21 } 25 }
22 26
23 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() { 27 void BrowserProcessPlatformPart::InitializeAutomaticRebootManager() {
24 DCHECK(!automatic_reboot_manager_); 28 DCHECK(!automatic_reboot_manager_);
25 29
26 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager( 30 automatic_reboot_manager_.reset(new chromeos::system::AutomaticRebootManager(
27 scoped_ptr<base::TickClock>(new base::DefaultTickClock))); 31 scoped_ptr<base::TickClock>(new base::DefaultTickClock)));
28 } 32 }
29 33
30 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() { 34 void BrowserProcessPlatformPart::ShutdownAutomaticRebootManager() {
31 automatic_reboot_manager_.reset(); 35 automatic_reboot_manager_.reset();
32 } 36 }
33 37
38 void BrowserProcessPlatformPart::InitializeSessionManager(
39 const base::CommandLine& parsed_command_line,
40 Profile* profile,
41 bool is_running_test) {
42 DCHECK(!session_manager_);
43 session_manager_ = chromeos::ChromeSessionManager::CreateSessionManager(
44 parsed_command_line, profile, is_running_test);
45 }
46
47 void BrowserProcessPlatformPart::ShutdownSessionManager() {
48 session_manager_.reset();
49 }
50
51 session_manager::SessionManager* BrowserProcessPlatformPart::session_manager() {
52 DCHECK(CalledOnValidThread());
53 return session_manager_.get();
54 }
55
34 chromeos::OomPriorityManager* 56 chromeos::OomPriorityManager*
35 BrowserProcessPlatformPart::oom_priority_manager() { 57 BrowserProcessPlatformPart::oom_priority_manager() {
36 DCHECK(CalledOnValidThread()); 58 DCHECK(CalledOnValidThread());
37 if (!oom_priority_manager_.get()) 59 if (!oom_priority_manager_.get())
38 oom_priority_manager_.reset(new chromeos::OomPriorityManager()); 60 oom_priority_manager_.reset(new chromeos::OomPriorityManager());
39 return oom_priority_manager_.get(); 61 return oom_priority_manager_.get();
40 } 62 }
41 63
42 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() { 64 chromeos::ProfileHelper* BrowserProcessPlatformPart::profile_helper() {
43 DCHECK(CalledOnValidThread()); 65 DCHECK(CalledOnValidThread());
(...skipping 16 matching lines...) Expand all
60 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() { 82 BrowserProcessPlatformPart::CreateBrowserPolicyConnector() {
61 return scoped_ptr<policy::BrowserPolicyConnector>( 83 return scoped_ptr<policy::BrowserPolicyConnector>(
62 new policy::BrowserPolicyConnectorChromeOS()); 84 new policy::BrowserPolicyConnectorChromeOS());
63 } 85 }
64 86
65 void BrowserProcessPlatformPart::CreateProfileHelper() { 87 void BrowserProcessPlatformPart::CreateProfileHelper() {
66 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL); 88 DCHECK(!created_profile_helper_ && profile_helper_.get() == NULL);
67 created_profile_helper_ = true; 89 created_profile_helper_ = true;
68 profile_helper_.reset(new chromeos::ProfileHelper()); 90 profile_helper_.reset(new chromeos::ProfileHelper());
69 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698