OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 static org.mockito.Mockito.doReturn; | 7 import static org.mockito.Mockito.doReturn; |
8 | 8 |
9 import android.util.Pair; | 9 import android.util.Pair; |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 List<ContextMenuItem> enabledItems = new ArrayList<>(); | 141 List<ContextMenuItem> enabledItems = new ArrayList<>(); |
142 for (int i = 0; i < contextMenuState.size(); i++) { | 142 for (int i = 0; i < contextMenuState.size(); i++) { |
143 enabledItems.addAll(contextMenuState.get(i).second); | 143 enabledItems.addAll(contextMenuState.get(i).second); |
144 } | 144 } |
145 return enabledItems; | 145 return enabledItems; |
146 } | 146 } |
147 | 147 |
148 private static ContextMenuParams createLinkContextParams() { | 148 private static ContextMenuParams createLinkContextParams() { |
149 return new ContextMenuParams( | 149 return new ContextMenuParams( |
150 0, PAGE_URL, LINK_URL, LINK_TEXT, "", "", "", false, null, false
); | 150 0, PAGE_URL, LINK_URL, LINK_TEXT, "", "", "", false, null, false
, 0, 0); |
151 } | 151 } |
152 | 152 |
153 private static ContextMenuParams createImageContextParams() { | 153 private static ContextMenuParams createImageContextParams() { |
154 return new ContextMenuParams(ContextMenuParams.MediaType.MEDIA_TYPE_IMAG
E, PAGE_URL, "", "", | 154 return new ContextMenuParams(ContextMenuParams.MediaType.MEDIA_TYPE_IMAG
E, PAGE_URL, "", "", |
155 IMAGE_SRC_URL, IMAGE_TITLE_TEXT, "", false, null, true); | 155 IMAGE_SRC_URL, IMAGE_TITLE_TEXT, "", false, null, true, 0, 0); |
156 } | 156 } |
157 | 157 |
158 private static ContextMenuParams createImageLinkContextParams() { | 158 private static ContextMenuParams createImageLinkContextParams() { |
159 return new ContextMenuParams(ContextMenuParams.MediaType.MEDIA_TYPE_IMAG
E, PAGE_URL, | 159 return new ContextMenuParams(ContextMenuParams.MediaType.MEDIA_TYPE_IMAG
E, PAGE_URL, |
160 PAGE_URL, LINK_URL, IMAGE_SRC_URL, IMAGE_TITLE_TEXT, "", false,
null, true); | 160 PAGE_URL, LINK_URL, IMAGE_SRC_URL, IMAGE_TITLE_TEXT, "", false,
null, true, 0, 0); |
161 } | 161 } |
162 } | 162 } |
OLD | NEW |