mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1200513
- Route http(s) url to gaia r=snorp
This commit is contained in:
parent
75a47d51a5
commit
486eb86701
@ -60,7 +60,10 @@
|
||||
<activity android:name="org.mozilla.b2gdroid.Launcher"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:icon="@drawable/b2g"
|
||||
android:label="@string/b2g">
|
||||
android:label="@string/b2g"
|
||||
android:launchMode="singleInstance"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:stateNotNeeded="true">
|
||||
|
||||
<!-- Set up as a homescreen replacement -->
|
||||
<intent-filter>
|
||||
|
@ -116,6 +116,7 @@ public class Launcher extends Activity
|
||||
Log.w(LOGTAG, "onDestroy");
|
||||
super.onDestroy();
|
||||
IntentHelper.destroy();
|
||||
mScreenStateObserver.destroy(this);
|
||||
mScreenStateObserver = null;
|
||||
|
||||
EventDispatcher.getInstance().unregisterGeckoThreadListener(this,
|
||||
@ -125,7 +126,7 @@ public class Launcher extends Activity
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent (Intent intent) {
|
||||
protected void onNewIntent(Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
Log.w(LOGTAG, "onNewIntent " + action);
|
||||
if (Intent.ACTION_VIEW.equals(action)) {
|
||||
|
@ -28,6 +28,11 @@ class ScreenStateObserver extends BroadcastReceiver {
|
||||
context.registerReceiver(this, filter);
|
||||
}
|
||||
|
||||
void destroy(Context context) {
|
||||
Log.d(LOGTAG, "ScreenStateObserver::unint");
|
||||
context.unregisterReceiver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d(LOGTAG, "ScreenStateObserver: " + intent.getAction());
|
||||
|
@ -34,15 +34,20 @@ this.MessagesBridge = {
|
||||
let data = JSON.parse(aData);
|
||||
debug(`Got Android:Launcher message ${data.action}`);
|
||||
|
||||
let window = SystemAppProxy.getFrame().contentWindow;
|
||||
switch (data.action) {
|
||||
case "screen_on":
|
||||
case "screen_off":
|
||||
// In both cases, make it look like pressing the power button
|
||||
// by dispatching keydown & keyup on the system app window.
|
||||
let window = SystemAppProxy.getFrame().contentWindow;
|
||||
window.dispatchEvent(new window.KeyboardEvent("keydown", { key: "Power" }));
|
||||
window.dispatchEvent(new window.KeyboardEvent("keyup", { key: "Power" }));
|
||||
break;
|
||||
case "view":
|
||||
let a = new window.MozActivity({ name: "view",
|
||||
data: { type: "url",
|
||||
url: data.url } });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user