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

Unified Diff: ash/wm/maximize_mode/maximize_mode_controller.cc

Issue 1229853004: Base: Make TimeDelta constructors deal with overflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static initializers Created 5 years, 5 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 | « no previous file | base/time/time.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/maximize_mode/maximize_mode_controller.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_controller.cc b/ash/wm/maximize_mode/maximize_mode_controller.cc
index 0f7325a6ba0caedec30605d899d28b3890c4719e..883317045edf3cd642a36199801705ec28a91418 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller.cc
@@ -57,8 +57,7 @@ const float kMaxStableAngle = 340.0f;
// This is used to prevent entering maximize mode if an erroneous accelerometer
// reading makes the lid appear to be fully open when the user is opening the
// lid from a closed position.
-const base::TimeDelta kLidRecentlyOpenedDuration =
- base::TimeDelta::FromSeconds(2);
+const int kLidRecentlyOpenedDurationSeconds = 2;
#if defined(OS_CHROMEOS)
// When the device approaches vertical orientation (i.e. portrait orientation)
@@ -369,7 +368,7 @@ bool MaximizeModeController::WasLidOpenedRecently() const {
base::TimeTicks now = tick_clock_->NowTicks();
DCHECK(now >= last_lid_open_time_);
base::TimeDelta elapsed_time = now - last_lid_open_time_;
- return elapsed_time <= kLidRecentlyOpenedDuration;
+ return elapsed_time.InSeconds() <= kLidRecentlyOpenedDurationSeconds;
}
void MaximizeModeController::SetTickClockForTest(
« no previous file with comments | « no previous file | base/time/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698