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

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

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 years, 7 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.history; 5 package org.chromium.chrome.browser.history;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.Intent; 8 import android.content.Intent;
9 9
10 import org.chromium.base.ContextUtils; 10 import org.chromium.base.ContextUtils;
(...skipping 13 matching lines...) Expand all
24 * Opens the browsing history manager. 24 * Opens the browsing history manager.
25 * 25 *
26 * @param activity The {@link ChromeActivity} that owns the {@link HistoryMa nager}. 26 * @param activity The {@link ChromeActivity} that owns the {@link HistoryMa nager}.
27 * @param tab The {@link Tab} to used to display the native page version of the 27 * @param tab The {@link Tab} to used to display the native page version of the
28 * {@link HistoryManager}. 28 * {@link HistoryManager}.
29 */ 29 */
30 public static void showHistoryManager(ChromeActivity activity, Tab tab) { 30 public static void showHistoryManager(ChromeActivity activity, Tab tab) {
31 Context appContext = ContextUtils.getApplicationContext(); 31 Context appContext = ContextUtils.getApplicationContext();
32 if (activity.getBottomSheet() != null) { 32 if (activity.getBottomSheet() != null) {
33 activity.getBottomSheetContentController().showContentAndOpenSheet(R .id.action_history); 33 activity.getBottomSheetContentController().showContentAndOpenSheet(R .id.action_history);
34 } else if (DeviceFormFactor.isTablet(appContext)) { 34 } else if (DeviceFormFactor.isTablet()) {
35 // History shows up as a tab on tablets. 35 // History shows up as a tab on tablets.
36 LoadUrlParams params = new LoadUrlParams(UrlConstants.NATIVE_HISTORY _URL); 36 LoadUrlParams params = new LoadUrlParams(UrlConstants.NATIVE_HISTORY _URL);
37 tab.loadUrl(params); 37 tab.loadUrl(params);
38 } else { 38 } else {
39 Intent intent = new Intent(); 39 Intent intent = new Intent();
40 intent.setClass(appContext, HistoryActivity.class); 40 intent.setClass(appContext, HistoryActivity.class);
41 intent.putExtra(IntentHandler.EXTRA_PARENT_COMPONENT, activity.getCo mponentName()); 41 intent.putExtra(IntentHandler.EXTRA_PARENT_COMPONENT, activity.getCo mponentName());
42 activity.startActivity(intent); 42 activity.startActivity(intent);
43 } 43 }
44 } 44 }
45 } 45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698