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

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: rebase 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Return early if the target window is not active. 113 // Return early if the target window is not active.
114 DVLOG(2) << "Skipping update on an inactive window"; 114 DVLOG(2) << "Skipping update on an inactive window";
115 Clear(); 115 Clear();
116 return false; 116 return false;
117 } 117 }
118 } 118 }
119 119
120 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) { 120 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) {
121 if (cursor_displayed_) { 121 if (cursor_displayed_) {
122 // Stop displaying cursor if there has been no mouse movement 122 // Stop displaying cursor if there has been no mouse movement
123 base::TimeDelta now = tick_clock_->NowTicks() - base::TimeTicks(); 123 base::TimeTicks now = tick_clock_->NowTicks();
124 if ((now - last_mouse_movement_timestamp_) > 124 if ((now - last_mouse_movement_timestamp_) >
125 base::TimeDelta::FromSeconds(MAX_IDLE_TIME_SECONDS)) { 125 base::TimeDelta::FromSeconds(MAX_IDLE_TIME_SECONDS)) {
126 cursor_displayed_ = false; 126 cursor_displayed_ = false;
127 DVLOG(2) << "Turning off cursor display after idle time"; 127 DVLOG(2) << "Turning off cursor display after idle time";
128 } 128 }
129 } 129 }
130 if (!cursor_displayed_) 130 if (!cursor_displayed_)
131 return false; 131 return false;
132 } 132 }
133 133
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 void CursorRendererAura::OnWindowDestroying(aura::Window* window) { 247 void CursorRendererAura::OnWindowDestroying(aura::Window* window) {
248 DCHECK_EQ(window_, window); 248 DCHECK_EQ(window_, window);
249 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement) 249 if (cursor_display_setting_ == kCursorEnabledOnMouseMovement)
250 window_->RemovePreTargetHandler(this); 250 window_->RemovePreTargetHandler(this);
251 window_->RemoveObserver(this); 251 window_->RemoveObserver(this);
252 window_ = nullptr; 252 window_ = nullptr;
253 } 253 }
254 254
255 } // namespace content 255 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/cursor_renderer_aura.h ('k') | content/browser/media/capture/cursor_renderer_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698