| OLD | NEW |
| 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 } |
| OLD | NEW |