Implement javascript close window method in the browser
This commit is contained in:
parent
c4e244a82b
commit
7e67770617
@ -2368,6 +2368,15 @@ public abstract class BrowserActivity extends ThemableActivity implements Browse
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the specified view, implementing the JavaScript callback to close a window
|
||||
* @param view the LightningView to close
|
||||
*/
|
||||
@Override
|
||||
public void onCloseWindow(LightningView view) {
|
||||
deleteTab(mWebViewList.indexOf(view));
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the Activity instance for this activity,
|
||||
* very helpful when creating things in other classes... I think
|
||||
|
@ -12,6 +12,8 @@ import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient.CustomViewCallback;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import acr.browser.lightning.view.LightningView;
|
||||
|
||||
public interface BrowserController {
|
||||
|
||||
void updateUrl(String title, boolean shortUrl);
|
||||
@ -36,6 +38,8 @@ public interface BrowserController {
|
||||
|
||||
void onCreateWindow(Message resultMsg);
|
||||
|
||||
void onCloseWindow(LightningView view);
|
||||
|
||||
Activity getActivity();
|
||||
|
||||
void hideActionBar();
|
||||
|
@ -998,8 +998,7 @@ public class LightningView {
|
||||
|
||||
@Override
|
||||
public void onCloseWindow(WebView window) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCloseWindow(window);
|
||||
mBrowserController.onCloseWindow(LightningView.this);
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user