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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.customtabs; 5 package org.chromium.chrome.browser.customtabs;
6 6
7 import android.app.Application;
8 import android.content.ComponentName; 7 import android.content.ComponentName;
9 import android.content.Context; 8 import android.content.Context;
10 import android.content.Intent; 9 import android.content.Intent;
11 import android.net.Uri; 10 import android.net.Uri;
12 import android.os.Process; 11 import android.os.Process;
13 import android.support.customtabs.CustomTabsIntent; 12 import android.support.customtabs.CustomTabsIntent;
14 import android.support.customtabs.CustomTabsSession; 13 import android.support.customtabs.CustomTabsSession;
15 14
16 import org.chromium.base.ThreadUtils; 15 import org.chromium.base.ThreadUtils;
17 import org.chromium.chrome.browser.document.ChromeLauncherActivity; 16 import org.chromium.chrome.browser.document.ChromeLauncherActivity;
(...skipping 13 matching lines...) Expand all
31 CustomTabsSession.createDummySessionForTesting( 30 CustomTabsSession.createDummySessionForTesting(
32 new ComponentName(context, ChromeLauncherActivity.class) )); 31 new ComponentName(context, ChromeLauncherActivity.class) ));
33 CustomTabsIntent customTabsIntent = builder.build(); 32 CustomTabsIntent customTabsIntent = builder.build();
34 Intent intent = customTabsIntent.intent; 33 Intent intent = customTabsIntent.intent;
35 intent.setAction(Intent.ACTION_VIEW); 34 intent.setAction(Intent.ACTION_VIEW);
36 intent.setData(Uri.parse(url)); 35 intent.setData(Uri.parse(url));
37 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 36 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
38 return intent; 37 return intent;
39 } 38 }
40 39
41 public static CustomTabsConnection setUpConnection(Application application) { 40 public static CustomTabsConnection setUpConnection() {
42 CustomTabsConnection connection = CustomTabsConnection.getInstance(appli cation); 41 CustomTabsConnection connection = CustomTabsConnection.getInstance();
43 connection.resetThrottling(application, Process.myUid()); 42 connection.resetThrottling(Process.myUid());
44 return connection; 43 return connection;
45 } 44 }
46 45
47 public static void cleanupSessions(final CustomTabsConnection connection) { 46 public static void cleanupSessions(final CustomTabsConnection connection) {
48 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 47 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
49 @Override 48 @Override
50 public void run() { 49 public void run() {
51 connection.cleanupAll(); 50 connection.cleanupAll();
52 } 51 }
53 }); 52 });
54 } 53 }
55 } 54 }
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698