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

Side by Side Diff: content/browser/android/overscroll_controller_android.cc

Issue 803343002: [Android] Add UMA for pull-to-refresh activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | tools/metrics/actions/actions.xml » ('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 "content/browser/android/overscroll_controller_android.h" 5 #include "content/browser/android/overscroll_controller_android.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/output/compositor_frame_metadata.h" 10 #include "cc/output/compositor_frame_metadata.h"
11 #include "content/browser/android/edge_effect.h" 11 #include "content/browser/android/edge_effect.h"
12 #include "content/browser/android/edge_effect_l.h" 12 #include "content/browser/android/edge_effect_l.h"
13 #include "content/browser/web_contents/web_contents_impl.h" 13 #include "content/browser/web_contents/web_contents_impl.h"
14 #include "content/common/input/did_overscroll_params.h" 14 #include "content/common/input/did_overscroll_params.h"
15 #include "content/public/browser/navigation_controller.h" 15 #include "content/public/browser/navigation_controller.h"
16 #include "content/public/browser/user_metrics.h"
16 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
17 #include "third_party/WebKit/public/web/WebInputEvent.h" 18 #include "third_party/WebKit/public/web/WebInputEvent.h"
18 #include "ui/android/resources/resource_manager.h" 19 #include "ui/android/resources/resource_manager.h"
19 #include "ui/base/android/window_android_compositor.h" 20 #include "ui/base/android/window_android_compositor.h"
20 21
21 namespace content { 22 namespace content {
22 namespace { 23 namespace {
23 24
24 // Used for conditional creation of EdgeEffect types for the overscroll glow. 25 // Used for conditional creation of EdgeEffect types for the overscroll glow.
25 const int kAndroidLSDKVersion = 21; 26 const int kAndroidLSDKVersion = 21;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (is_fullscreen_) 271 if (is_fullscreen_)
271 refresh_effect_->ReleaseWithoutActivation(); 272 refresh_effect_->ReleaseWithoutActivation();
272 } 273 }
273 274
274 void OverscrollControllerAndroid::TriggerRefresh() { 275 void OverscrollControllerAndroid::TriggerRefresh() {
275 triggered_refresh_active_ = false; 276 triggered_refresh_active_ = false;
276 if (!web_contents()) 277 if (!web_contents())
277 return; 278 return;
278 279
279 triggered_refresh_active_ = true; 280 triggered_refresh_active_ = true;
281 RecordAction(base::UserMetricsAction("MobilePullGestureReload"));
280 web_contents()->GetController().Reload(true); 282 web_contents()->GetController().Reload(true);
281 } 283 }
282 284
283 bool OverscrollControllerAndroid::IsStillRefreshing() const { 285 bool OverscrollControllerAndroid::IsStillRefreshing() const {
284 return triggered_refresh_active_; 286 return triggered_refresh_active_;
285 } 287 }
286 288
287 scoped_ptr<EdgeEffectBase> OverscrollControllerAndroid::CreateEdgeEffect() { 289 scoped_ptr<EdgeEffectBase> OverscrollControllerAndroid::CreateEdgeEffect() {
288 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_); 290 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_);
289 } 291 }
290 292
291 void OverscrollControllerAndroid::SetNeedsAnimate() { 293 void OverscrollControllerAndroid::SetNeedsAnimate() {
292 compositor_->SetNeedsAnimate(); 294 compositor_->SetNeedsAnimate();
293 } 295 }
294 296
295 } // namespace content 297 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698