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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyUrlsAdapter.java

Issue 2224223002: Combine Physical Web URLs into groups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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.physicalweb; 5 package org.chromium.chrome.browser.physicalweb;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 import android.view.LayoutInflater; 9 import android.view.LayoutInflater;
10 import android.view.View; 10 import android.view.View;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 /** 46 /**
47 * Return true if we already know an icon for this URL. 47 * Return true if we already know an icon for this URL.
48 * @param iconUrl The icon URL as returned by PWS 48 * @param iconUrl The icon URL as returned by PWS
49 * @return true if the icon is present 49 * @return true if the icon is present
50 */ 50 */
51 public boolean hasIcon(String iconUrl) { 51 public boolean hasIcon(String iconUrl) {
52 return mIconUrlToIconMap.containsKey(iconUrl); 52 return mIconUrlToIconMap.containsKey(iconUrl);
53 } 53 }
54 54
55 /** 55 /**
56 * Return true if we already know we have a given groupId.
57 * @param groupId The requested groupId
58 * @return true if a PwsResult is present that has the given groupId
59 */
60 public boolean hasGroupId(String groupId) {
61 for (int position = 0; position < getCount(); ++position) {
62 if (groupId.equals(getItem(position).groupId)) {
63 return true;
64 }
65 }
66 return false;
67 }
68
69 /**
56 * Get the view for an item in the data set. 70 * Get the view for an item in the data set.
57 * @param position Index of the list view item within the array. 71 * @param position Index of the list view item within the array.
58 * @param view The old view to reuse, if possible. 72 * @param view The old view to reuse, if possible.
59 * @param viewGroup The parent that this view will eventually be attached to . 73 * @param viewGroup The parent that this view will eventually be attached to .
60 * @return A view corresponding to the list view item. 74 * @return A view corresponding to the list view item.
61 */ 75 */
62 @Override 76 @Override
63 public View getView(int position, View view, ViewGroup viewGroup) { 77 public View getView(int position, View view, ViewGroup viewGroup) {
64 if (view == null) { 78 if (view == null) {
65 LayoutInflater inflater = LayoutInflater.from(getContext()); 79 LayoutInflater inflater = LayoutInflater.from(getContext());
(...skipping 26 matching lines...) Expand all
92 for (int position = 0; position < itemCount; ++position) { 106 for (int position = 0; position < itemCount; ++position) {
93 PwsResult pwsResult = getItem(position); 107 PwsResult pwsResult = getItem(position);
94 if (siteUrl.equals(pwsResult.siteUrl)) { 108 if (siteUrl.equals(pwsResult.siteUrl)) {
95 return true; 109 return true;
96 } 110 }
97 } 111 }
98 112
99 return false; 113 return false;
100 } 114 }
101 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698