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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity2.java

Issue 1909043002: Add UMA metrics for multi-window mode and multi-instance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 package org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import org.chromium.base.metrics.RecordUserAction;
8
7 /** 9 /**
8 * A subclass of ChromeTabbedActivity, used in Android N multi-window mode. 10 * A subclass of ChromeTabbedActivity, used in Android N multi-window mode.
9 * 11 *
10 * This activity can appear side-by-side with ChromeTabbedActivity in multi-wind ow mode. It has a 12 * This activity can appear side-by-side with ChromeTabbedActivity in multi-wind ow mode. It has a
11 * separate set of tabs, as determined by logic in TabWindowManager. 13 * separate set of tabs, as determined by logic in TabWindowManager.
12 * 14 *
13 * Since ChromeTabbedActivity has launchMode="singleTask" in the manifest, there can't be two 15 * Since ChromeTabbedActivity has launchMode="singleTask" in the manifest, there can't be two
14 * instances of ChromeTabbedActivity; hence this activity is needed. Moreover, h aving separately- 16 * instances of ChromeTabbedActivity; hence this activity is needed. Moreover, h aving separately-
15 * named activities makes it possible to bring either existing activity to the f oreground on the 17 * named activities makes it possible to bring either existing activity to the f oreground on the
16 * desired side of the screen when firing an intent. 18 * desired side of the screen when firing an intent.
17 */ 19 */
18 public class ChromeTabbedActivity2 extends ChromeTabbedActivity {} 20 public class ChromeTabbedActivity2 extends ChromeTabbedActivity {
21 @Override
22 protected void onDeferredStartupForMultiWindowMode() {
23 RecordUserAction.record("Android.MultiWindowMode.MultiInstance.Enter");
24 recordMultiWindowModeScreenWidth();
25 }
26
27 @Override
28 protected void recordMultiWindowModeChangedUserAction(boolean isInMultiWindo wMode) {
29 // Record separate user actions for entering/exiting multi-window mode t o avoid recording
30 // the same action twice when two instances are running.
31 if (isInMultiWindowMode) {
32 RecordUserAction.record("Android.MultiWindowMode.Enter-SecondInstanc e");
33 } else {
34 RecordUserAction.record("Android.MultiWindowMode.Exit-SecondInstance ");
35 }
36 }
37 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698