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

Unified Diff: chromeos/display/output_configurator.cc

Issue 10831312: Remove direct DBus calls from OutputConfigurator (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/display/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/display/output_configurator.cc
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc
index 9504ef5b4d5383d521ace0dd43d455e43d890505..5a56be12a51d7d15cf1c0af540a878a6d71bd4b8 100644
--- a/chromeos/display/output_configurator.cc
+++ b/chromeos/display/output_configurator.cc
@@ -23,12 +23,7 @@
#include "base/metrics/histogram.h"
#include "base/perftimer.h"
#include "chromeos/dbus/dbus_thread_manager.h"
-#include "dbus/bus.h"
-#include "dbus/exported_object.h"
-#include "dbus/message.h"
-#include "dbus/object_path.h"
-#include "dbus/object_proxy.h"
-#include "third_party/cros_system_api/dbus/service_constants.h"
+#include "chromeos/dbus/power_manager_client.h"
namespace chromeos {
@@ -235,19 +230,6 @@ OutputConfigurator::OutputConfigurator(bool is_extended_display_enabled)
output_state_(STATE_INVALID) {
if (!is_running_on_chrome_os_)
return;
- // Send the signal to powerd to tell it that we will take over output
- // control.
- // Note that this can be removed once the legacy powerd support is removed.
- chromeos::DBusThreadManager* manager = chromeos::DBusThreadManager::Get();
- dbus::Bus* bus = manager->GetSystemBus();
- if (bus) {
- dbus::ExportedObject* remote_object = bus->GetExportedObject(
- dbus::ObjectPath(power_manager::kPowerManagerServicePath));
- dbus::Signal signal(power_manager::kPowerManagerInterface,
- power_manager::kUseNewMonitorConfigSignal);
- CHECK(signal.raw_message() != NULL);
- remote_object->SendSignal(&signal);
- }
// Cache the initial output state.
Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
@@ -851,22 +833,8 @@ void OutputConfigurator::CheckIsProjectingAndNotify() {
// "Projecting" is defined as having more than 1 output connected while at
// least one of them is an internal output.
bool is_projecting = has_internal_output && (connected_output_count > 1);
- chromeos::DBusThreadManager* manager = chromeos::DBusThreadManager::Get();
- dbus::Bus* bus = manager->GetSystemBus();
- if (bus) {
- dbus::ObjectProxy* power_manager_proxy = bus->GetObjectProxy(
- power_manager::kPowerManagerServiceName,
- dbus::ObjectPath(power_manager::kPowerManagerServicePath));
- dbus::MethodCall method_call(
- power_manager::kPowerManagerInterface,
- power_manager::kSetIsProjectingMethod);
- dbus::MessageWriter writer(&method_call);
- writer.AppendBool(is_projecting);
- power_manager_proxy->CallMethod(
- &method_call,
- dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
- dbus::ObjectProxy::EmptyResponseCallback());
- }
+ chromeos::DBusThreadManager::Get()->GetPowerManagerClient()
+ ->SetIsProjecting(is_projecting);
}
void OutputConfigurator::NotifyOnDisplayChanged() {
« no previous file with comments | « chromeos/display/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698