Home | History | Annotate | Download | only in preferences

Lines Matching defs:Site

62     private static final String EXTRA_SITE = "site";
66 private Site mSite = null;
68 static class Site implements Parcelable {
74 // These constants provide the set of features that a site may support
83 public Site(String origin) {
103 * Gets the number of features supported by this site.
114 * Gets the ID of the nth (zero-based) feature supported by this site.
117 * position in the list of features for this site. This is used both
173 private Site(Parcel in) {
180 public static final Parcelable.Creator<Site> CREATOR
181 = new Parcelable.Creator<Site>() {
182 public Site createFromParcel(Parcel in) {
183 return new Site(in);
186 public Site[] newArray(int size) {
187 return new Site[size];
193 class SiteAdapter extends ArrayAdapter<Site>
203 private Site mCurrentSite;
209 public SiteAdapter(Context context, int rsc, Site site) {
225 mCurrentSite = site;
232 * Adds the specified feature to the site corresponding to supplied
233 * origin in the map. Creates the site if it does not already exist.
235 private void addFeatureToSite(Map<String, Site> sites, String origin, int feature) {
236 Site site = null;
238 site = (Site) sites.get(origin);
240 site = new Site(origin);
241 sites.put(origin, site);
243 site.addFeature(feature);
258 Map<String, Site> sites = new HashMap<String, Site>();
262 addFeatureToSite(sites, iter.next(), Site.FEATURE_WEB_STORAGE);
270 public void askForGeolocation(final Map<String, Site> sites) {
276 addFeatureToSite(sites, iter.next(), Site.FEATURE_GEOLOCATION);
285 public void populateIcons(Map<String, Site> sites) {
296 private Map<String, Site> mSites;
298 public UpdateFromBookmarksDbTask(Context ctx, Map<String, Site> sites) {
304 HashMap<String, Set<Site>> hosts = new HashMap<String, Set<Site>>();
305 Set<Map.Entry<String, Site>> elements = mSites.entrySet();
306 Iterator<Map.Entry<String, Site>> originIter = elements.iterator();
308 Map.Entry<String, Site> entry = originIter.next();
309 Site site = entry.getValue();
311 Set<Site> hostSites = null;
313 hostSites = (Set<Site>)hosts.get(host);
315 hostSites = new HashSet<Site>();
318 hostSites.add(site);
343 Iterator<Site> sitesIter = matchingSites.iterator();
345 Site site = sitesIter.next();
352 if (url.equals(site.getOrigin()) ||
353 (new String(site.getOrigin()+"/")).equals(url)) {
355 site.setTitle(title);
360 site.setIcon(bmp);
379 public void populateOrigins(Map<String, Site> sites) {
382 // We can now simply populate our array with Site instances
383 Set<Map.Entry<String, Site>> elements = sites.entrySet();
384 Iterator<Map.Entry<String, Site>> entryIterator = elements.iterator();
386 Map.Entry<String, Site> entry = entryIterator.next();
387 Site site = entry.getValue();
388 add(site);
420 * site's settings, we want to go back to the main
480 Site site = getItem(position);
481 title.setText(site.getPrettyTitle());
482 String subtitleText = site.getPrettyOrigin();
498 Bitmap bmp = site.getIcon();
503 // We set the site as the view's tag,
505 view.setTag(site);
507 String origin = site.getOrigin();
508 if (site.hasFeature(Site.FEATURE_WEB_STORAGE)) {
519 if (site.hasFeature(Site.FEATURE_GEOLOCATION)) {
540 case Site.FEATURE_WEB_STORAGE:
553 case Site.FEATURE_GEOLOCATION:
582 case Site.FEATURE_WEB_STORAGE:
589 // If this site has no more features, then go back to the
591 mCurrentSite.removeFeature(Site.FEATURE_WEB_STORAGE);
602 case Site.FEATURE_GEOLOCATION:
609 mCurrentSite.removeFeature(Site.FEATURE_GEOLOCATION);
622 Site site = (Site) view.getTag();
626 args.putParcelable(EXTRA_SITE, site);
628 site.getPrettyTitle(), null, 0);
633 public Site currentSite() {
644 mSite = (Site) args.getParcelable(EXTRA_SITE);