cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcesarmob...@apache.org
Subject cordova-plugin-inappbrowser git commit: CB-9274 Adds missing methods to InAppBrowser to allow compilation for Amazon FireOS.
Date Sun, 13 Nov 2016 16:30:55 GMT
Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master f8747a700 -> 5cbbc8e26


CB-9274 Adds missing methods to InAppBrowser to allow compilation for Amazon FireOS.

 This closes #107


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/5cbbc8e2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/5cbbc8e2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/5cbbc8e2

Branch: refs/heads/master
Commit: 5cbbc8e26ee6f9231b319229eaf75d5e008d5e64
Parents: f8747a7
Author: ipaterson <ipaterson@newstex.com>
Authored: Wed Jul 1 14:10:18 2015 -0400
Committer: Julio C├ęsar <jcesarmobile@gmail.com>
Committed: Sun Nov 13 17:30:09 2016 +0100

----------------------------------------------------------------------
 src/amazon/InAppBrowser.java | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/5cbbc8e2/src/amazon/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/amazon/InAppBrowser.java b/src/amazon/InAppBrowser.java
index 5c53488..c5d6f66 100644
--- a/src/amazon/InAppBrowser.java
+++ b/src/amazon/InAppBrowser.java
@@ -84,6 +84,7 @@ public class InAppBrowser extends CordovaPlugin {
     private static final String LOAD_ERROR_EVENT = "loaderror";
     private static final String CLEAR_ALL_CACHE = "clearcache";
     private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
+    private static final String HARDWARE_BACK_BUTTON = "hardwareback";
 
     private InAppBrowserDialog dialog;
     private AmazonWebView inAppWebView;
@@ -94,6 +95,7 @@ public class InAppBrowser extends CordovaPlugin {
     private boolean openWindowHidden = false;
     private boolean clearAllCache= false;
     private boolean clearSessionCache=false;
+    private boolean hadwareBackButton=true;
 
     /**
      * Executes the request and returns PluginResult.
@@ -378,7 +380,7 @@ public class InAppBrowser extends CordovaPlugin {
     /**
      * Checks to see if it is possible to go back one page in history, then does so.
      */
-    private void goBack() {
+    public void goBack() {
         this.cordova.getActivity().runOnUiThread(new Runnable() {
             public void run() {
                 if (InAppBrowser.this.inAppWebView.canGoBack()) {
@@ -389,6 +391,22 @@ public class InAppBrowser extends CordovaPlugin {
     }
 
     /**
+     * Can the web browser go back?
+     * @return boolean
+     */
+    public boolean canGoBack() {
+        return this.inAppWebView.canGoBack();
+    }
+
+    /**
+     * Has the user set the hardware back button to go back
+     * @return boolean
+     */
+    public boolean hardwareBack() {
+        return hadwareBackButton;
+    } 
+
+    /**
      * Checks to see if it is possible to go forward one page in history, then does so.
      */
     private void goForward() {
@@ -469,6 +487,10 @@ public class InAppBrowser extends CordovaPlugin {
             if (hidden != null) {
                 openWindowHidden = hidden.booleanValue();
             }
+            Boolean hardwareBack = features.get(HARDWARE_BACK_BUTTON);
+            if (hardwareBack != null) {
+                hadwareBackButton = hardwareBack.booleanValue();
+            }
             Boolean cache = features.get(CLEAR_ALL_CACHE);
             if (cache != null) {
                 clearAllCache = cache.booleanValue();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message