mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
commit
60f1ffc5a7
7 changed files with 42 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -93,6 +93,8 @@ public class JNIServo {
|
|||
|
||||
void makeCurrent();
|
||||
|
||||
void onAlert(String message);
|
||||
|
||||
void onAnimatingChanged(boolean animating);
|
||||
|
||||
void onLoadStarted();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue