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

Unified Diff: chromeos/dbus/services/display_power_service_provider.cc

Issue 739123002: Move DisplayPowerServiceProvider to chromeos/dbus/services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/services/display_power_service_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/services/display_power_service_provider.cc
diff --git a/chrome/browser/chromeos/dbus/display_power_service_provider.cc b/chromeos/dbus/services/display_power_service_provider.cc
similarity index 74%
rename from chrome/browser/chromeos/dbus/display_power_service_provider.cc
rename to chromeos/dbus/services/display_power_service_provider.cc
index 507e9a72eb1abbed835394e8ebf585811a7609d2..9f44d0e7cb9db103cf25bf7da0432f78f8fcf026 100644
--- a/chrome/browser/chromeos/dbus/display_power_service_provider.cc
+++ b/chromeos/dbus/services/display_power_service_provider.cc
@@ -2,20 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/dbus/display_power_service_provider.h"
+#include "chromeos/dbus/services/display_power_service_provider.h"
-#include "ash/shell.h"
#include "base/bind.h"
-#include "dbus/bus.h"
#include "dbus/message.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
-#include "ui/display/chromeos/display_configurator.h"
-#include "ui/wm/core/user_activity_detector.h"
namespace chromeos {
-DisplayPowerServiceProvider::DisplayPowerServiceProvider()
- : weak_ptr_factory_(this) {
+DisplayPowerServiceProvider::DisplayPowerServiceProvider(
+ scoped_ptr<Delegate> delegate)
+ : delegate_(delegate.Pass()),
+ weak_ptr_factory_(this) {
}
DisplayPowerServiceProvider::~DisplayPowerServiceProvider() {}
@@ -53,15 +51,8 @@ void DisplayPowerServiceProvider::SetDisplayPower(
dbus::MessageReader reader(method_call);
int int_state = 0;
if (reader.PopInt32(&int_state)) {
- // Turning displays off when the device becomes idle or on just before
- // we suspend may trigger a mouse move, which would then be incorrectly
- // reported as user activity. Let the UserActivityDetector
- // know so that it can ignore such events.
- wm::UserActivityDetector::Get()->OnDisplayPowerChanging();
-
DisplayPowerState state = static_cast<DisplayPowerState>(int_state);
- ash::Shell::GetInstance()->display_configurator()->SetDisplayPower(
- state, ui::DisplayConfigurator::kSetDisplayPowerNoFlags);
+ delegate_->SetDisplayPower(state);
} else {
LOG(ERROR) << "Unable to parse " << kSetDisplayPower << " request";
}
@@ -75,7 +66,7 @@ void DisplayPowerServiceProvider::SetDisplaySoftwareDimming(
dbus::MessageReader reader(method_call);
bool dimmed = false;
if (reader.PopBool(&dimmed)) {
- ash::Shell::GetInstance()->SetDimming(dimmed);
+ delegate_->SetDimming(dimmed);
} else {
LOG(ERROR) << "Unable to parse " << kSetDisplaySoftwareDimming
<< " request";
« no previous file with comments | « chromeos/dbus/services/display_power_service_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698