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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.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.app.Activity; 7 import android.app.Activity;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.content.ComponentName; 9 import android.content.ComponentName;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 @VisibleForTesting 261 @VisibleForTesting
262 Intent getOpenUrlIntent(String url, Boolean isIncognito, boolean createNewTa b) { 262 Intent getOpenUrlIntent(String url, Boolean isIncognito, boolean createNewTa b) {
263 // Construct basic intent. 263 // Construct basic intent.
264 Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); 264 Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
265 viewIntent.putExtra(Browser.EXTRA_APPLICATION_ID, 265 viewIntent.putExtra(Browser.EXTRA_APPLICATION_ID,
266 mActivity.getApplicationContext().getPackageName()); 266 mActivity.getApplicationContext().getPackageName());
267 viewIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 267 viewIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
268 268
269 // Determine component or class name. 269 // Determine component or class name.
270 ComponentName component; 270 ComponentName component;
271 if (DeviceFormFactor.isTablet(mActivity)) { 271 if (DeviceFormFactor.isTablet()) {
272 component = mActivity.getComponentName(); 272 component = mActivity.getComponentName();
273 } else { 273 } else {
274 component = IntentUtils.safeGetParcelableExtra( 274 component = IntentUtils.safeGetParcelableExtra(
275 mActivity.getIntent(), IntentHandler.EXTRA_PARENT_COMPONENT) ; 275 mActivity.getIntent(), IntentHandler.EXTRA_PARENT_COMPONENT) ;
276 } 276 }
277 if (component != null) { 277 if (component != null) {
278 viewIntent.setComponent(component); 278 viewIntent.setComponent(component);
279 } else { 279 } else {
280 viewIntent.setClass(mActivity, ChromeLauncherActivity.class); 280 viewIntent.setClass(mActivity, ChromeLauncherActivity.class);
281 } 281 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 @Override 406 @Override
407 public void onAction(Object actionData) { 407 public void onAction(Object actionData) {
408 // Handler for the link copied snackbar. Do nothing. 408 // Handler for the link copied snackbar. Do nothing.
409 } 409 }
410 410
411 @Override 411 @Override
412 public void onDismissNoAction(Object actionData) { 412 public void onDismissNoAction(Object actionData) {
413 // Handler for the link copied snackbar. Do nothing. 413 // Handler for the link copied snackbar. Do nothing.
414 } 414 }
415 } 415 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698