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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java

Issue 2632103002: (Android) Replacing deprecated API with current (Closed)
Patch Set: Indentation fix after previous patch set Created 3 years, 11 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.customtabs; 5 package org.chromium.chrome.browser.customtabs;
6 6
7 import android.app.PendingIntent; 7 import android.app.PendingIntent;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.SharedPreferences; 10 import android.content.SharedPreferences;
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 * Show the web page with CustomTabActivity, without any navigation control. 1030 * Show the web page with CustomTabActivity, without any navigation control.
1031 * Used in showing the terms of services page or help pages for Chrome. 1031 * Used in showing the terms of services page or help pages for Chrome.
1032 * @param context The current activity context. 1032 * @param context The current activity context.
1033 * @param url The url of the web page. 1033 * @param url The url of the web page.
1034 */ 1034 */
1035 public static void showInfoPage(Context context, String url) { 1035 public static void showInfoPage(Context context, String url) {
1036 // TODO(xingliu): The title text will be the html document title, figure out if we want to 1036 // TODO(xingliu): The title text will be the html document title, figure out if we want to
1037 // use Chrome strings here as EmbedContentViewActivity does. 1037 // use Chrome strings here as EmbedContentViewActivity does.
1038 CustomTabsIntent customTabIntent = new CustomTabsIntent.Builder() 1038 CustomTabsIntent customTabIntent = new CustomTabsIntent.Builder()
1039 .setShowTitle(true) 1039 .setShowTitle(true)
1040 .setToolbarColor(context.getResources().getColor(R.color.dark_ac tion_bar_color)) 1040 .setToolbarColor(ApiCompatibilityUtils.getColor(
1041 context.getResources(),
1042 R.color.dark_action_bar_color))
1041 .build(); 1043 .build();
1042 customTabIntent.intent.setData(Uri.parse(url)); 1044 customTabIntent.intent.setData(Uri.parse(url));
1043 1045
1044 Intent intent = ChromeLauncherActivity.createCustomTabActivityIntent( 1046 Intent intent = ChromeLauncherActivity.createCustomTabActivityIntent(
1045 context, customTabIntent.intent, false); 1047 context, customTabIntent.intent, false);
1046 intent.setPackage(context.getPackageName()); 1048 intent.setPackage(context.getPackageName());
1047 intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_INFO_PAGE, true); 1049 intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_INFO_PAGE, true);
1048 intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); 1050 intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
1049 IntentHandler.addTrustedIntentExtras(intent); 1051 IntentHandler.addTrustedIntentExtras(intent);
1050 1052
1051 context.startActivity(intent); 1053 context.startActivity(intent);
1052 } 1054 }
1053 } 1055 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698