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

Side by Side Diff: components/session_manager/core/session_manager.cc

Issue 363613004: [cros] Define session_manager component with SessionManager base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/session_manager/core/session_manager.h"
6
7 #include "base/logging.h"
8
9 namespace session_manager {
10
11 SessionManager::SessionManager() : session_state_(SESSION_STATE_UNKNOWN) {
12 }
13
14 SessionManager::~SessionManager() {
15 }
16
17 void SessionManager::SetSessionState(SessionState state) {
18 VLOG(1) << "Changing session state to: " << state;
19
20 if (session_state_ != state) {
21 // TODO(nkostylev): Notify observers about the state change.
22 // TODO(nkostylev): Add code to process session state change and probably
23 // replace delegate_ if needed.
24 session_state_ = state;
25 }
26 }
27
28 void SessionManager::Initialize(SessionManagerDelegate* delegate) {
29 DCHECK(delegate);
30 delegate_.reset(delegate);
31 delegate_->SetSessionManager(this);
32 }
33
34 void SessionManager::Start() {
35 delegate_->Start();
36 }
37
38 SessionManagerDelegate::SessionManagerDelegate() : session_manager_(NULL) {
39 }
40
41 SessionManagerDelegate::~SessionManagerDelegate() {
42 }
43
44 void SessionManagerDelegate::SetSessionManager(
45 session_manager::SessionManager* session_manager) {
46 session_manager_ = session_manager;
47 }
48
49 } // namespace session_manager
OLDNEW
« no previous file with comments | « components/session_manager/core/session_manager.h ('k') | components/session_manager/session_manager_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698