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

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

Issue 2623993007: 🏠 Extract the ContentSuggestionManager interface from NTP (Closed)
Patch Set: Fix tests 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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698