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

Side by Side Diff: chrome/browser/chromeos/power/screen_dimming_observer.cc

Issue 10263011: chromeos: Add support for dimming the screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/power/screen_dimming_observer.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "chrome/browser/chromeos/power/screen_dimming_observer.h"
6
7 #include "ash/shell.h"
8 #include "ash/wm/screen_dimmer.h"
9 #include "chromeos/dbus/dbus_thread_manager.h"
10
11 namespace chromeos {
12
13 ScreenDimmingObserver::ScreenDimmingObserver() {
14 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
15 }
16
17 ScreenDimmingObserver::~ScreenDimmingObserver() {
18 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
19 }
20
21 void ScreenDimmingObserver::ScreenDimmingRequested(ScreenDimmingState state) {
22 ash::Shell::GetInstance()->screen_dimmer()->SetDimming(
23 state == PowerManagerClient::Observer::SCREEN_DIMMING_IDLE);
24 }
25
26 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/power/screen_dimming_observer.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698