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

Side by Side Diff: content/browser/media/capture/cursor_renderer_aura.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge master Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "content/browser/media/capture/cursor_renderer_aura.h" 5 #include "content/browser/media/capture/cursor_renderer_aura.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // Return early if the target window is not active. 109 // Return early if the target window is not active.
110 DVLOG(2) << "Skipping update on an inactive window"; 110 DVLOG(2) << "Skipping update on an inactive window";
111 Clear(); 111 Clear();
112 return false; 112 return false;
113 } 113 }
114 } 114 }
115 115
116 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) { 116 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) {
117 if (cursor_displayed_) { 117 if (cursor_displayed_) {
118 // Stop displaying cursor if there has been no mouse movement 118 // Stop displaying cursor if there has been no mouse movement
119 base::TimeDelta now = tick_clock_->NowTicks() - base::TimeTicks(); 119 base::TimeTicks now = tick_clock_->NowTicks();
120 if ((now - last_mouse_movement_timestamp_) > 120 if ((now - last_mouse_movement_timestamp_) >
121 base::TimeDelta::FromSeconds(MAX_IDLE_TIME_SECONDS)) { 121 base::TimeDelta::FromSeconds(MAX_IDLE_TIME_SECONDS)) {
122 cursor_displayed_ = false; 122 cursor_displayed_ = false;
123 DVLOG(2) << "Turning off cursor display after idle time"; 123 DVLOG(2) << "Turning off cursor display after idle time";
124 } 124 }
125 } 125 }
126 if (!cursor_displayed_) 126 if (!cursor_displayed_)
127 return false; 127 return false;
128 } 128 }
129 129
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 void CursorRendererAura::OnWindowDestroying(aura::Window* window) { 243 void CursorRendererAura::OnWindowDestroying(aura::Window* window) {
244 DCHECK_EQ(window_, window); 244 DCHECK_EQ(window_, window);
245 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) 245 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement)
246 window_->RemovePreTargetHandler(this); 246 window_->RemovePreTargetHandler(this);
247 window_->RemoveObserver(this); 247 window_->RemoveObserver(this);
248 window_ = nullptr; 248 window_ = nullptr;
249 } 249 }
250 250
251 } // namespace content 251 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698