mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #21658 - paulrouget:loaduri, r=jdm
Save initial URI even for all loadUri methods <!-- 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/21658) <!-- Reviewable:end -->
This commit is contained in:
commit
f37124563b
1 changed files with 12 additions and 13 deletions
|
@ -38,7 +38,7 @@ public class ServoSurface {
|
|||
private Servo mServo;
|
||||
private Client mClient = null;
|
||||
private String mServoArgs = "";
|
||||
private Uri mInitialUri = null;
|
||||
private String mInitialUri = null;
|
||||
private Activity mActivity;
|
||||
|
||||
public ServoSurface(Surface surface, int width, int height) {
|
||||
|
@ -82,7 +82,15 @@ public class ServoSurface {
|
|||
}
|
||||
|
||||
public void loadUri(String uri) {
|
||||
if (mServo != null) {
|
||||
mServo.loadUri(uri);
|
||||
} else {
|
||||
mInitialUri = uri;
|
||||
}
|
||||
}
|
||||
|
||||
public void loadUri(Uri uri) {
|
||||
loadUri(uri.toString());
|
||||
}
|
||||
|
||||
public void scrollStart(int dx, int dy, int x, int y) {
|
||||
|
@ -105,14 +113,6 @@ public class ServoSurface {
|
|||
mServo.resize(width, height);
|
||||
}
|
||||
|
||||
public void loadUri(Uri uri) {
|
||||
if (mServo != null) {
|
||||
mServo.loadUri(uri.toString());
|
||||
} else {
|
||||
mInitialUri = uri;
|
||||
}
|
||||
}
|
||||
|
||||
static class GLSurface implements GfxCallbacks {
|
||||
private EGLConfig[] mEGLConfigs;
|
||||
private EGLDisplay mEglDisplay;
|
||||
|
@ -196,15 +196,14 @@ public class ServoSurface {
|
|||
|
||||
GLSurface surface = new GLSurface(mASurface);
|
||||
|
||||
final boolean showLogs = true;
|
||||
String uri = mInitialUri == null ? null : mInitialUri.toString();
|
||||
|
||||
mGLLooperHandler = new Handler() {
|
||||
public void handleMessage(Message msg) {
|
||||
}
|
||||
};
|
||||
|
||||
inUIThread(() -> {
|
||||
final boolean showLogs = true;
|
||||
String uri = mInitialUri == null ? null : mInitialUri;
|
||||
mServo = new Servo(this, surface, mClient, mActivity, mServoArgs, uri, mWidth, mHeight, showLogs);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue