Beispiel #1
0
 @Override
 public boolean areContentsSecure() {
   URIParsedResult uriResult = (URIParsedResult) getResult();
   String uri = uriResult.getURI().toLowerCase(Locale.ENGLISH);
   for (String secure : SECURE_PROTOCOLS) {
     if (uri.startsWith(secure)) {
       return true;
     }
   }
   return false;
 }
 @Override
 public void handleButtonPress(int index) {
   URIParsedResult uriResult = (URIParsedResult) getResult();
   String uri = uriResult.getURI();
   switch (index) {
     case 0:
       openURL(uri);
       break;
     case 1:
       shareByEmail(uri);
       break;
     case 2:
       shareBySMS(uri);
       break;
   }
 }
Beispiel #3
0
 @Override
 public void handleButtonPress(ICaptureProvider captureProvider, int index) {
   URIParsedResult uriResult = (URIParsedResult) getResult();
   String uri = uriResult.getURI();
   switch (index) {
     case 0:
       openURL(uri);
       break;
     case 1:
       shareByEmail(uri);
       break;
     case 2:
       shareBySMS(uri);
       break;
     case 3:
       searchBookContents(uri);
       break;
   }
 }
 @Override
 void retrieveSupplementalInfo() throws IOException {
   URI oldURI;
   try {
     oldURI = new URI(result.getURI());
   } catch (URISyntaxException ignored) {
     return;
   }
   URI newURI = HttpHelper.unredirect(oldURI);
   int count = 0;
   while (count++ < MAX_REDIRECTS && !oldURI.equals(newURI)) {
     append(
         result.getDisplayResult(),
         null,
         new String[] {redirectString + " : " + newURI},
         newURI.toString());
     oldURI = newURI;
     newURI = HttpHelper.unredirect(newURI);
   }
 }
 TitleRetriever(TextView textView, URIParsedResult result) {
   super(textView);
   this.httpUrl = result.getURI();
 }