Auto merge of #23801 - paulrouget:alert, r=jdm

Expose javascript:window.alert() to libsimpleservo

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23801)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-19 21:18:42 -04:00 committed by GitHub
commit 60f1ffc5a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 0 deletions

View file

@ -129,6 +129,10 @@ public class MainActivity extends Activity implements Servo.Client {
mServoView.stop();
}
@Override
public void onAlert(String message) {
}
@Override
public void onLoadStarted() {
mReloadButton.setEnabled(false);

View file

@ -93,6 +93,8 @@ public class JNIServo {
void makeCurrent();
void onAlert(String message);
void onAnimatingChanged(boolean animating);
void onLoadStarted();

View file

@ -169,6 +169,8 @@ public class Servo {
}
public interface Client {
void onAlert(String message);
boolean onAllowNavigation(String url);
void onLoadStarted();
@ -228,6 +230,10 @@ public class Servo {
mGfxCb.makeCurrent();
}
public void onAlert(String message) {
mRunCallback.inUIThread(() -> mClient.onAlert(message));
}
public void onShutdownComplete() {
mShutdownComplete = true;
}