Chromium Code Reviews| 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.document; | 5 package org.chromium.chrome.browser.document; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.Notification; | 9 import android.app.Notification; |
| 10 import android.app.PendingIntent; | 10 import android.app.PendingIntent; |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 480 | 480 |
| 481 /** | 481 /** |
| 482 * Tries to launch the First Run Experience. If ChromeLauncherActivity is r unning with the | 482 * Tries to launch the First Run Experience. If ChromeLauncherActivity is r unning with the |
| 483 * wrong Intent flags, we instead relaunch ChromeLauncherActivity to make su re it runs in its | 483 * wrong Intent flags, we instead relaunch ChromeLauncherActivity to make su re it runs in its |
| 484 * own task, which then triggers First Run. | 484 * own task, which then triggers First Run. |
| 485 * @return Whether or not the First Run Experience needed to be shown. | 485 * @return Whether or not the First Run Experience needed to be shown. |
| 486 */ | 486 */ |
| 487 private boolean launchFirstRunExperience() { | 487 private boolean launchFirstRunExperience() { |
| 488 final boolean isIntentActionMain = getIntent() != null | 488 final boolean isIntentActionMain = getIntent() != null |
| 489 && TextUtils.equals(getIntent().getAction(), Intent.ACTION_MAIN) ; | 489 && TextUtils.equals(getIntent().getAction(), Intent.ACTION_MAIN) ; |
| 490 final Intent freIntent = FirstRunFlowSequencer.checkIfFirstRunIsNecessar y( | 490 final Intent freIntent = |
| 491 this, isIntentActionMain); | 491 FirstRunFlowSequencer.checkIfFirstRunIsNecessary(this, isIntentA ctionMain, |
| 492 IntentHandler.determineExternalIntentSource(getPackageNa me(), getIntent())); | |
|
Bernhard Bauer
2016/06/16 16:35:36
You pass this to checkIfFirstRunIsNecessary() ever
gogerald1
2016/06/16 18:59:20
Done.
| |
| 492 if (freIntent == null) return false; | 493 if (freIntent == null) return false; |
| 493 | 494 |
| 494 if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { | 495 if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { |
| 495 startActivityForResult(freIntent, FIRST_RUN_EXPERIENCE_REQUEST_CODE) ; | 496 startActivityForResult(freIntent, FIRST_RUN_EXPERIENCE_REQUEST_CODE) ; |
| 496 } else { | 497 } else { |
| 497 Intent newIntent = new Intent(getIntent()); | 498 Intent newIntent = new Intent(getIntent()); |
| 498 newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 499 newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 499 startActivity(newIntent); | 500 startActivity(newIntent); |
| 500 finish(); | 501 finish(); |
| 501 } | 502 } |
| 502 return true; | 503 return true; |
| 503 } | 504 } |
| 504 | 505 |
| 505 /** | 506 /** |
| 506 * Records metrics gleaned from the Intent. | 507 * Records metrics gleaned from the Intent. |
| 507 */ | 508 */ |
| 508 private void recordIntentMetrics() { | 509 private void recordIntentMetrics() { |
| 509 Intent intent = getIntent(); | 510 Intent intent = getIntent(); |
| 510 IntentHandler.ExternalAppId source = | 511 IntentHandler.ExternalAppId source = |
| 511 IntentHandler.determineExternalIntentSource(getPackageName(), in tent); | 512 IntentHandler.determineExternalIntentSource(getPackageName(), in tent); |
| 512 if (intent.getPackage() == null && source != IntentHandler.ExternalAppId .CHROME) { | 513 if (intent.getPackage() == null && source != IntentHandler.ExternalAppId .CHROME) { |
| 513 int flagsOfInterest = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_AC TIVITY_NEW_DOCUMENT; | 514 int flagsOfInterest = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_AC TIVITY_NEW_DOCUMENT; |
| 514 int maskedFlags = intent.getFlags() & flagsOfInterest; | 515 int maskedFlags = intent.getFlags() & flagsOfInterest; |
| 515 sIntentFlagsHistogram.record(maskedFlags); | 516 sIntentFlagsHistogram.record(maskedFlags); |
| 516 } | 517 } |
| 517 MediaNotificationUma.recordClickSource(intent); | 518 MediaNotificationUma.recordClickSource(intent); |
| 518 } | 519 } |
| 519 } | 520 } |
| OLD | NEW |