1 // Copyright 2013 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.
5 #include "chrome/browser/chromeos/extensions/extension_system_event_observer.h"
7 #include "chrome/browser/extensions/api/system_private/system_private_api.h"
8 #include "chromeos/dbus/dbus_thread_manager.h"
12 ExtensionSystemEventObserver::ExtensionSystemEventObserver() {
13 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
14 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this);
17 ExtensionSystemEventObserver::~ExtensionSystemEventObserver() {
18 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
19 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
22 void ExtensionSystemEventObserver::BrightnessChanged(int level
,
23 bool user_initiated
) {
24 extensions::DispatchBrightnessChangedEvent(level
, user_initiated
);
27 void ExtensionSystemEventObserver::SuspendDone(
28 const base::TimeDelta
& sleep_duration
) {
29 extensions::DispatchWokeUpEvent();
32 void ExtensionSystemEventObserver::ScreenIsUnlocked() {
33 extensions::DispatchScreenUnlockedEvent();
36 } // namespace chromeos