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

Side by Side Diff: ash/wm/maximize_mode/maximize_mode_controller.cc

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller.h ('k') | base/test/simple_test_tick_clock.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/accelerometer/accelerometer_controller.h" 9 #include "ash/accelerometer/accelerometer_controller.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 if (last_lid_open_time_.is_null()) 484 if (last_lid_open_time_.is_null())
485 return false; 485 return false;
486 486
487 base::TimeTicks now = tick_clock_->NowTicks(); 487 base::TimeTicks now = tick_clock_->NowTicks();
488 DCHECK(now >= last_lid_open_time_); 488 DCHECK(now >= last_lid_open_time_);
489 base::TimeDelta elapsed_time = now - last_lid_open_time_; 489 base::TimeDelta elapsed_time = now - last_lid_open_time_;
490 return elapsed_time <= kLidRecentlyOpenedDuration; 490 return elapsed_time <= kLidRecentlyOpenedDuration;
491 } 491 }
492 492
493 void MaximizeModeController::SetTickClockForTest( 493 void MaximizeModeController::SetTickClockForTest(
494 scoped_ptr<base::TickClock> tick_clock) { 494 const scoped_refptr<base::TickClock>& tick_clock) {
495 DCHECK(tick_clock_); 495 DCHECK(tick_clock_.get() != NULL);
496 tick_clock_ = tick_clock.Pass(); 496 tick_clock_ = tick_clock;
497 } 497 }
498 498
499 } // namespace ash 499 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller.h ('k') | base/test/simple_test_tick_clock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698