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

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

Issue 2966193002: customtabs: Remove unnecessary Context plumbing. (Closed)
Patch Set: Rebase. Created 3 years, 5 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.firstrun; 5 package org.chromium.chrome.browser.firstrun;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.Fragment; 8 import android.app.Fragment;
9 import android.app.PendingIntent; 9 import android.app.PendingIntent;
10 import android.app.PendingIntent.CanceledException; 10 import android.app.PendingIntent.CanceledException;
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_COMPLETE, comp lete); 578 extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_COMPLETE, comp lete);
579 579
580 try { 580 try {
581 // After the PendingIntent has been sent, send a first run callback to custom tabs if 581 // After the PendingIntent has been sent, send a first run callback to custom tabs if
582 // necessary. 582 // necessary.
583 PendingIntent.OnFinished onFinished = new PendingIntent.OnFinished() { 583 PendingIntent.OnFinished onFinished = new PendingIntent.OnFinished() {
584 @Override 584 @Override
585 public void onSendFinished(PendingIntent pendingIntent, Intent i ntent, 585 public void onSendFinished(PendingIntent pendingIntent, Intent i ntent,
586 int resultCode, String resultData, Bundle resultExtras) { 586 int resultCode, String resultData, Bundle resultExtras) {
587 if (ChromeLauncherActivity.isCustomTabIntent(intent)) { 587 if (ChromeLauncherActivity.isCustomTabIntent(intent)) {
588 CustomTabsConnection.getInstance( 588 CustomTabsConnection.getInstance().sendFirstRunCallbackI fNecessary(
589 getApplication()).sendFirstRunCallbackIfNecessar y(intent, complete); 589 intent, complete);
590 } 590 }
591 } 591 }
592 }; 592 };
593 593
594 // Use the PendingIntent to send the intent that originally launched Chrome. The intent 594 // Use the PendingIntent to send the intent that originally launched Chrome. The intent
595 // will go back to the ChromeLauncherActivity, which will route it a ccordingly. 595 // will go back to the ChromeLauncherActivity, which will route it a ccordingly.
596 pendingIntent.send(this, complete ? Activity.RESULT_OK : Activity.RE SULT_CANCELED, 596 pendingIntent.send(this, complete ? Activity.RESULT_OK : Activity.RE SULT_CANCELED,
597 extraDataIntent, onFinished, null); 597 extraDataIntent, onFinished, null);
598 return true; 598 return true;
599 } catch (CanceledException e) { 599 } catch (CanceledException e) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 public void showInfoPage(int url) { 666 public void showInfoPage(int url) {
667 CustomTabActivity.showInfoPage(this, getString(url)); 667 CustomTabActivity.showInfoPage(this, getString(url));
668 } 668 }
669 669
670 @VisibleForTesting 670 @VisibleForTesting
671 public static void setObserverForTest(FirstRunActivityObserver observer) { 671 public static void setObserverForTest(FirstRunActivityObserver observer) {
672 assert sObserver == null; 672 assert sObserver == null;
673 sObserver = observer; 673 sObserver = observer;
674 } 674 }
675 } 675 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698