| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
| 9 import android.app.Activity; | 9 import android.app.Activity; |
| 10 import android.app.ActivityManager; | 10 import android.app.ActivityManager; |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS
_MANAGER); | 1244 NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS
_MANAGER); |
| 1245 } | 1245 } |
| 1246 RecordUserAction.record("MobileMenuDownloadManager"); | 1246 RecordUserAction.record("MobileMenuDownloadManager"); |
| 1247 } else if (id == R.id.open_recently_closed_tab) { | 1247 } else if (id == R.id.open_recently_closed_tab) { |
| 1248 TabModel currentModel = mTabModelSelectorImpl.getCurrentModel(); | 1248 TabModel currentModel = mTabModelSelectorImpl.getCurrentModel(); |
| 1249 if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosed
Tab(); | 1249 if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosed
Tab(); |
| 1250 RecordUserAction.record("MobileTabClosedUndoShortCut"); | 1250 RecordUserAction.record("MobileTabClosedUndoShortCut"); |
| 1251 } else if (id == R.id.enter_vr_id) { | 1251 } else if (id == R.id.enter_vr_id) { |
| 1252 mVrShellDelegate.enterVRIfNecessary(); | 1252 mVrShellDelegate.enterVRIfNecessary(); |
| 1253 } else if (id == R.id.content_suggestions_standalone_ui) { | 1253 } else if (id == R.id.content_suggestions_standalone_ui) { |
| 1254 ContentSuggestionsActivity.launch(getApplicationContext()); | 1254 ContentSuggestionsActivity.launch(this); |
| 1255 } else { | 1255 } else { |
| 1256 return super.onMenuOrKeyboardAction(id, fromMenu); | 1256 return super.onMenuOrKeyboardAction(id, fromMenu); |
| 1257 } | 1257 } |
| 1258 return true; | 1258 return true; |
| 1259 } | 1259 } |
| 1260 | 1260 |
| 1261 private void recordBackPressedUma(String logMessage, @BackPressedResult int
action) { | 1261 private void recordBackPressedUma(String logMessage, @BackPressedResult int
action) { |
| 1262 Log.i(TAG, "Back pressed: " + logMessage); | 1262 Log.i(TAG, "Back pressed: " + logMessage); |
| 1263 RecordHistogram.recordEnumeratedHistogram( | 1263 RecordHistogram.recordEnumeratedHistogram( |
| 1264 "Android.Activity.ChromeTabbedActivity.SystemBackAction", | 1264 "Android.Activity.ChromeTabbedActivity.SystemBackAction", |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 | 1759 |
| 1760 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT
IVITY_SERVICE); | 1760 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT
IVITY_SERVICE); |
| 1761 for (AppTask task : manager.getAppTasks()) { | 1761 for (AppTask task : manager.getAppTasks()) { |
| 1762 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); | 1762 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); |
| 1763 if (info == null) continue; | 1763 if (info == null) continue; |
| 1764 if (info.id == sMergedInstanceTaskId) return true; | 1764 if (info.id == sMergedInstanceTaskId) return true; |
| 1765 } | 1765 } |
| 1766 return false; | 1766 return false; |
| 1767 } | 1767 } |
| 1768 } | 1768 } |
| OLD | NEW |