diff options
Diffstat (limited to 'ash/session/session_state_observer.cc')
-rw-r--r-- | ash/session/session_state_observer.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ash/session/session_state_observer.cc b/ash/session/session_state_observer.cc new file mode 100644 index 0000000..48c994e --- /dev/null +++ b/ash/session/session_state_observer.cc @@ -0,0 +1,25 @@ +// Copyright 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. + +#include "ash/session/session_state_observer.h" + +#include "ash/session/session_state_delegate.h" +#include "ash/shell.h" + +namespace ash { + +ScopedSessionStateObserver::ScopedSessionStateObserver( + ash::SessionStateObserver* observer) + : observer_(observer) { + ash::Shell::GetInstance()->session_state_delegate()->AddSessionStateObserver( + observer_); +} + +ScopedSessionStateObserver::~ScopedSessionStateObserver() { + ash::Shell::GetInstance() + ->session_state_delegate() + ->RemoveSessionStateObserver(observer_); +} + +} // namespace ash |