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

Side by Side Diff: ui/aura/mus/user_activity_forwarder.cc

Issue 2639703004: mus: Forward user activity from window server to detector. (Closed)
Patch Set: fix mash_unittests and use NON_EXPORTED_BASE() Created 3 years, 11 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/aura/mus/user_activity_forwarder.h"
6
7 #include <cmath>
8
9 #include "ui/base/user_activity/user_activity_detector.h"
10
11 namespace aura {
12
13 UserActivityForwarder::UserActivityForwarder(
14 ui::mojom::UserActivityMonitorPtr monitor,
15 ui::UserActivityDetector* detector)
16 : monitor_(std::move(monitor)), binding_(this), detector_(detector) {
17 DCHECK(detector_);
18
19 // Round UserActivityDetector's notification interval up to the nearest
20 // second (the granularity exposed by UserActivityMonitor).
21 const uint32_t kNotifyIntervalSec = static_cast<uint32_t>(
James Cook 2017/01/20 03:38:49 nit: #include <stdint.h> for uint32_t ?
Daniel Erat 2017/01/20 16:49:45 Done.
22 ceil(ui::UserActivityDetector::kNotifyIntervalMs / 1000.0));
23 monitor_->AddUserActivityObserver(kNotifyIntervalSec,
24 binding_.CreateInterfacePtrAndBind());
25 }
26
27 UserActivityForwarder::~UserActivityForwarder() {}
28
29 void UserActivityForwarder::OnUserActivity() {
30 detector_->HandleExternalUserActivity();
31 }
32
33 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698