diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-03 02:35:54 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-03 02:35:54 +0000 |
commit | 5ab25b4d00615fe7146247ffbbfa7ca130ecad49 (patch) | |
tree | 3599af1fe5ec4ce591e0b4a287a08aca5a0f1b58 /chromeos | |
parent | 959a8bfe7d9f39adf85dc1034c028cbea815e884 (diff) | |
download | chromium_src-5ab25b4d00615fe7146247ffbbfa7ca130ecad49.zip chromium_src-5ab25b4d00615fe7146247ffbbfa7ca130ecad49.tar.gz chromium_src-5ab25b4d00615fe7146247ffbbfa7ca130ecad49.tar.bz2 |
chromeos: Use native D-Bus args for HandleVideoActivity.
This updates HandleVideoActivity D-Bus method calls to the
power manager to send a single "is_fullscreen" boolean
argument instead of the heavier-weight protocol buffer that
was used before. Doing so shortens some code and allows the
removal of an old protobuf build target.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/18385003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/chromeos.gyp | 16 | ||||
-rw-r--r-- | chromeos/dbus/fake_power_manager_client.cc | 4 | ||||
-rw-r--r-- | chromeos/dbus/fake_power_manager_client.h | 4 | ||||
-rw-r--r-- | chromeos/dbus/power_manager_client.cc | 19 | ||||
-rw-r--r-- | chromeos/dbus/power_manager_client.h | 4 |
5 files changed, 6 insertions, 41 deletions
diff --git a/chromeos/chromeos.gyp b/chromeos/chromeos.gyp index f2d8a35..3eef745 100644 --- a/chromeos/chromeos.gyp +++ b/chromeos/chromeos.gyp @@ -26,7 +26,6 @@ '../url/url.gyp:url_lib', 'ime/input_method.gyp:gencode', 'power_manager_proto', - 'video_activity_update_proto', ], 'defines': [ 'CHROMEOS_IMPLEMENTATION', @@ -522,7 +521,6 @@ }, { # Protobuf compiler/generator for power-manager related protocol buffers. - # TODO(derat): Remove other protocol buffers in favor of these. 'target_name': 'power_manager_proto', 'type': 'static_library', 'sources': [ @@ -538,19 +536,5 @@ }, 'includes': ['../build/protoc.gypi'], }, - { - # Protobuf compiler / generator for the VideoActivityUpdate protocol - # buffer. - 'target_name': 'video_activity_update_proto', - 'type': 'static_library', - 'sources': [ - '../third_party/cros_system_api/dbus/video_activity_update.proto', - ], - 'variables': { - 'proto_in_dir': '../third_party/cros_system_api/dbus/', - 'proto_out_dir': 'chromeos/dbus', - }, - 'includes': ['../build/protoc.gypi'], - }, ], } diff --git a/chromeos/dbus/fake_power_manager_client.cc b/chromeos/dbus/fake_power_manager_client.cc index df1ef54..f0054ce 100644 --- a/chromeos/dbus/fake_power_manager_client.cc +++ b/chromeos/dbus/fake_power_manager_client.cc @@ -60,9 +60,7 @@ void FakePowerManagerClient::IncreaseKeyboardBrightness() { void FakePowerManagerClient::IncreaseScreenBrightness() { } -void FakePowerManagerClient::NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) { +void FakePowerManagerClient::NotifyVideoActivity(bool is_fullscreen) { } void FakePowerManagerClient::DecreaseKeyboardBrightness() { diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h index 89d2b6e..130edd2 100644 --- a/chromeos/dbus/fake_power_manager_client.h +++ b/chromeos/dbus/fake_power_manager_client.h @@ -37,9 +37,7 @@ class FakePowerManagerClient : public PowerManagerClient { virtual void RequestShutdown() OVERRIDE; virtual void RequestIdleNotification(int64 threshold_secs) OVERRIDE; virtual void NotifyUserActivity() OVERRIDE; - virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) OVERRIDE; + virtual void NotifyVideoActivity(bool is_fullscreen) OVERRIDE; virtual void SetPolicy( const power_manager::PowerManagementPolicy& policy) OVERRIDE; virtual void SetIsProjecting(bool is_projecting) OVERRIDE; diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc index 1031381..d2fd3f8 100644 --- a/chromeos/dbus/power_manager_client.cc +++ b/chromeos/dbus/power_manager_client.cc @@ -22,7 +22,6 @@ #include "chromeos/dbus/power_manager/policy.pb.h" #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" #include "chromeos/dbus/power_manager/suspend.pb.h" -#include "chromeos/dbus/video_activity_update.pb.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -251,23 +250,13 @@ class PowerManagerClientImpl : public PowerManagerClient { SimpleMethodCallToPowerManager(power_manager::kHandleUserActivityMethod); } - virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) OVERRIDE { + virtual void NotifyVideoActivity(bool is_fullscreen) OVERRIDE { dbus::MethodCall method_call( power_manager::kPowerManagerInterface, power_manager::kHandleVideoActivityMethod); dbus::MessageWriter writer(&method_call); + writer.AppendBool(is_fullscreen); - VideoActivityUpdate protobuf; - protobuf.set_last_activity_time(last_activity_time.ToInternalValue()); - protobuf.set_is_fullscreen(is_fullscreen); - - if (!writer.AppendProtoAsArrayOfBytes(protobuf)) { - LOG(ERROR) << "Error calling " - << power_manager::kHandleVideoActivityMethod; - return; - } power_manager_proxy_->CallMethod( &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, @@ -742,9 +731,7 @@ class PowerManagerClientStubImpl : public PowerManagerClient { } virtual void NotifyUserActivity() OVERRIDE {} - virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) OVERRIDE {} + virtual void NotifyVideoActivity(bool is_fullscreen) OVERRIDE {} virtual void SetPolicy( const power_manager::PowerManagementPolicy& policy) OVERRIDE {} virtual void SetIsProjecting(bool is_projecting) OVERRIDE {} diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h index d1ae021..6424094 100644 --- a/chromeos/dbus/power_manager_client.h +++ b/chromeos/dbus/power_manager_client.h @@ -144,9 +144,7 @@ class CHROMEOS_EXPORT PowerManagerClient { // Notifies the power manager that a video is currently playing. It also // includes whether or not the containing window for the video is fullscreen. - virtual void NotifyVideoActivity( - const base::TimeTicks& last_activity_time, - bool is_fullscreen) = 0; + virtual void NotifyVideoActivity(bool is_fullscreen) = 0; // Tells the power manager to begin using |policy|. virtual void SetPolicy( |