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

Side by Side Diff: chrome/android/java/src/android/support/customtabs/CustomTabsIntent.java

Issue 1509713004: Add a default share button to the menu of Custom Tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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 android.support.customtabs; 5 package android.support.customtabs;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.ActivityOptions; 8 import android.app.ActivityOptions;
9 import android.app.PendingIntent; 9 import android.app.PendingIntent;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 /** 85 /**
86 * Bundle constructed out of {@link ActivityOptions} that will be running wh en the 86 * Bundle constructed out of {@link ActivityOptions} that will be running wh en the
87 * {@link Activity} that holds the custom tab gets finished. A similar Activ ityOptions 87 * {@link Activity} that holds the custom tab gets finished. A similar Activ ityOptions
88 * for creation should be constructed and given to the startActivity() call that 88 * for creation should be constructed and given to the startActivity() call that
89 * launches the custom tab. 89 * launches the custom tab.
90 */ 90 */
91 public static final String EXTRA_EXIT_ANIMATION_BUNDLE = 91 public static final String EXTRA_EXIT_ANIMATION_BUNDLE =
92 "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE"; 92 "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
93 93
94 /** 94 /**
95 * Boolean that specifies whether a default share button will be shown in th e menu.
96 */
97 public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM =
98 "android.support.customtabs.extra.SHARE_MENU_ITEM";
99
100 /**
95 * Convenience method to create a VIEW intent without a session for the give n package. 101 * Convenience method to create a VIEW intent without a session for the give n package.
96 * @param packageName The package name to set in the intent. 102 * @param packageName The package name to set in the intent.
97 * @param data The data {@link Uri} to be used in the intent. 103 * @param data The data {@link Uri} to be used in the intent.
98 * @return The intent with the given package, data and the right session extra. 104 * @return The intent with the given package, data and the right session extra.
99 */ 105 */
100 public static Intent getViewIntentWithNoSession(String packageName, Uri data ) { 106 public static Intent getViewIntentWithNoSession(String packageName, Uri data ) {
101 Intent intent = new Intent(Intent.ACTION_VIEW, data); 107 Intent intent = new Intent(Intent.ACTION_VIEW, data);
102 intent.setPackage(packageName); 108 intent.setPackage(packageName);
103 Bundle extras = new Bundle(); 109 Bundle extras = new Bundle();
104 if (!safePutBinder(extras, EXTRA_SESSION, null)) return null; 110 if (!safePutBinder(extras, EXTRA_SESSION, null)) return null;
(...skipping 18 matching lines...) Expand all
123 Bundle.class.getMethod("putIBinder", String.class, IBind er.class); 129 Bundle.class.getMethod("putIBinder", String.class, IBind er.class);
124 putBinderMethod.invoke(bundle, key, binder); 130 putBinderMethod.invoke(bundle, key, binder);
125 } 131 }
126 } catch (InvocationTargetException | IllegalAccessException | IllegalArg umentException 132 } catch (InvocationTargetException | IllegalAccessException | IllegalArg umentException
127 | NoSuchMethodException e) { 133 | NoSuchMethodException e) {
128 return false; 134 return false;
129 } 135 }
130 return true; 136 return true;
131 } 137 }
132 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698