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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuParams.java

Issue 2883983005: Only enable copy options before FRE is completed on Android. (Closed)
Patch Set: Update tests to cover all context menu modes (required no prod code changes) Created 3 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.contextmenu; 5 package org.chromium.chrome.browser.contextmenu;
6 6
7 import android.text.TextUtils; 7 import android.text.TextUtils;
8 8
9 import org.chromium.base.VisibleForTesting; 9 import org.chromium.base.VisibleForTesting;
10 import org.chromium.base.annotations.CalledByNative; 10 import org.chromium.base.annotations.CalledByNative;
11 import org.chromium.base.annotations.JNINamespace; 11 import org.chromium.base.annotations.JNINamespace;
12 import org.chromium.chrome.browser.UrlConstants; 12 import org.chromium.chrome.browser.UrlConstants;
13 import org.chromium.content_public.common.Referrer; 13 import org.chromium.content_public.common.Referrer;
14 14
15 /** 15 /**
16 * A list of parameters that explain what kind of context menu to show the user. This data is 16 * A list of parameters that explain what kind of context menu to show the user. This data is
17 * generated from content/public/common/context_menu_params.h. 17 * generated from content/public/common/context_menu_params.h.
18 */ 18 */
19 @JNINamespace("ContextMenuParamsAndroid") 19 @JNINamespace("ContextMenuParamsAndroid")
20 public class ContextMenuParams { 20 public class ContextMenuParams {
21 /** Must correspond to the MediaType enum in WebKit/chromium/public/WebConte xtMenuData.h */ 21 /** Must correspond to the MediaType enum in WebKit/chromium/public/WebConte xtMenuData.h */
22 @SuppressWarnings("unused") 22 @SuppressWarnings("unused")
23 private static interface MediaType { 23 static interface MediaType {
24 public static final int MEDIA_TYPE_NONE = 0; 24 public static final int MEDIA_TYPE_NONE = 0;
25 public static final int MEDIA_TYPE_IMAGE = 1; 25 public static final int MEDIA_TYPE_IMAGE = 1;
26 public static final int MEDIA_TYPE_VIDEO = 2; 26 public static final int MEDIA_TYPE_VIDEO = 2;
27 public static final int MEDIA_TYPE_AUDIO = 3; 27 public static final int MEDIA_TYPE_AUDIO = 3;
28 public static final int MEDIA_TYPE_FILE = 4; 28 public static final int MEDIA_TYPE_FILE = 4;
29 public static final int MEDIA_TYPE_PLUGIN = 5; 29 public static final int MEDIA_TYPE_PLUGIN = 5;
30 } 30 }
31 31
32 private final String mPageUrl; 32 private final String mPageUrl;
33 private final String mLinkUrl; 33 private final String mLinkUrl;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 private static ContextMenuParams create(int mediaType, String pageUrl, Strin g linkUrl, 157 private static ContextMenuParams create(int mediaType, String pageUrl, Strin g linkUrl,
158 String linkText, String unfilteredLinkUrl, String srcUrl, String tit leText, 158 String linkText, String unfilteredLinkUrl, String srcUrl, String tit leText,
159 boolean imageWasFetchedLoFi, String sanitizedReferrer, int referrerP olicy, 159 boolean imageWasFetchedLoFi, String sanitizedReferrer, int referrerP olicy,
160 boolean canSavemedia) { 160 boolean canSavemedia) {
161 Referrer referrer = TextUtils.isEmpty(sanitizedReferrer) 161 Referrer referrer = TextUtils.isEmpty(sanitizedReferrer)
162 ? null : new Referrer(sanitizedReferrer, referrerPolicy); 162 ? null : new Referrer(sanitizedReferrer, referrerPolicy);
163 return new ContextMenuParams(mediaType, pageUrl, linkUrl, linkText, unfi lteredLinkUrl, 163 return new ContextMenuParams(mediaType, pageUrl, linkUrl, linkText, unfi lteredLinkUrl,
164 srcUrl, titleText, imageWasFetchedLoFi, referrer, canSavemedia); 164 srcUrl, titleText, imageWasFetchedLoFi, referrer, canSavemedia);
165 } 165 }
166 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698