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

Side by Side Diff: ui/base/user_activity/user_activity_detector.cc

Issue 1923943003: Add logging to remote commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Syslog logging in upload_job_impl 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
« no previous file with comments | « ui/base/user_activity/user_activity_detector.h ('k') | no next file » | 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 "ui/base/user_activity/user_activity_detector.h" 5 #include "ui/base/user_activity/user_activity_detector.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 && GetCurrentTime() < honor_mouse_events_time_) 110 && GetCurrentTime() < honor_mouse_events_time_)
111 return; 111 return;
112 } 112 }
113 113
114 HandleActivity(event); 114 HandleActivity(event);
115 } 115 }
116 116
117 void UserActivityDetector::HandleActivity(const ui::Event* event) { 117 void UserActivityDetector::HandleActivity(const ui::Event* event) {
118 base::TimeTicks now = GetCurrentTime(); 118 base::TimeTicks now = GetCurrentTime();
119 last_activity_time_ = now; 119 last_activity_time_ = now;
120 last_activity_name_ = event->name();
120 if (last_observer_notification_time_.is_null() || 121 if (last_observer_notification_time_.is_null() ||
121 (now - last_observer_notification_time_).InMillisecondsF() >= 122 (now - last_observer_notification_time_).InMillisecondsF() >=
122 kNotifyIntervalMs) { 123 kNotifyIntervalMs) {
123 if (VLOG_IS_ON(1)) 124 if (VLOG_IS_ON(1))
124 VLOG(1) << "Reporting user activity: " << GetEventDebugString(event); 125 VLOG(1) << "Reporting user activity: " << GetEventDebugString(event);
125 FOR_EACH_OBSERVER(UserActivityObserver, observers_, OnUserActivity(event)); 126 FOR_EACH_OBSERVER(UserActivityObserver, observers_, OnUserActivity(event));
126 last_observer_notification_time_ = now; 127 last_observer_notification_time_ = now;
127 } 128 }
128 } 129 }
129 130
130 } // namespace ui 131 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/user_activity/user_activity_detector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698