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