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

Unified Diff: chromeos/dbus/power_manager_client.cc

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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
Index: chromeos/dbus/power_manager_client.cc
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index 9019dd9c0e042d3d4a0cf3b0e7ab2d2d332f5c48..db4ec08d71f9e0af0ae6a81ee572f059e081409b 100644
--- a/chromeos/dbus/power_manager_client.cc
+++ b/chromeos/dbus/power_manager_client.cc
@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/callback.h"
-#include "base/command_line.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -18,7 +17,7 @@
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "chromeos/chromeos_switches.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager/input_event.pb.h"
#include "chromeos/dbus/power_manager/peripheral_battery_status.pb.h"
#include "chromeos/dbus/power_manager/policy.pb.h"
@@ -675,12 +674,11 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
// PowerManagerClient overrides:
virtual void Init(dbus::Bus* bus) OVERRIDE {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kEnableStubInteractive)) {
- const int kStatusUpdateMs = 1000;
+ int cycle_delay = DBusThreadManager::Get()->GetPowerCycleDelay();
+ if (cycle_delay) {
update_timer_.Start(FROM_HERE,
- base::TimeDelta::FromMilliseconds(kStatusUpdateMs), this,
- &PowerManagerClientStubImpl::UpdateStatus);
+ base::TimeDelta::FromSeconds(cycle_delay), this,
+ &PowerManagerClientStubImpl::UpdateStatus);
}
}

Powered by Google App Engine
This is Rietveld 408576698