merge fx-team to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2013-11-05 13:27:23 +01:00
commit 4bf96ae1a8
5 changed files with 27 additions and 8 deletions

View File

@ -1208,7 +1208,7 @@ public class GeckoAppShell
context.getResources().getString(R.string.share_title));
}
final Uri uri = normalizeUriScheme(Uri.parse(targetURI));
final Uri uri = normalizeUriScheme(targetURI.indexOf(':') >= 0 ? Uri.parse(targetURI) : new Uri.Builder().scheme(targetURI).build());
if (mimeType.length() > 0) {
Intent intent = getIntentForActionString(action);
intent.setDataAndType(uri, mimeType);

View File

@ -536,6 +536,7 @@
<item name="android:textAppearance">?android:textAppearanceSmall</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:maxWidth">160dp</item>
<item name="android:textColor">#fff</item>
<item name="android:layout_gravity">center_vertical</item>
</style>

View File

@ -116,7 +116,7 @@ public class ButtonToast {
mMessageView.setText(t.message);
mButton.setText(t.buttonMessage);
mButton.setCompoundDrawablePadding(mView.getContext().getResources().getDimensionPixelSize(R.dimen.toast_button_padding));
mButton.setCompoundDrawablesWithIntrinsicBounds(null, null, t.buttonDrawable, null);
mButton.setCompoundDrawablesWithIntrinsicBounds(t.buttonDrawable, null, null, null);
mHideHandler.removeCallbacks(mHideRunnable);
mHideHandler.postDelayed(mHideRunnable, TOAST_DURATION);

View File

@ -9,6 +9,10 @@ const Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
function sendMessageToJava(aMessage) {
return Services.androidBridge.handleGeckoMessage(JSON.stringify(aMessage));
}
function ContentDispatchChooser() {}
ContentDispatchChooser.prototype =
@ -49,13 +53,25 @@ ContentDispatchChooser.prototype =
let win = this._getChromeWin();
if (win && win.NativeWindow) {
let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
let text = bundle.GetStringFromName("protocol.failed");
win.NativeWindow.toast.show(text, "long");
let failedText = bundle.GetStringFromName("protocol.failed");
let searchText = bundle.GetStringFromName("protocol.toast.search");
win.NativeWindow.toast.show(failedText, "long", {
button: {
label: searchText,
callback: function() {
let message = {
type: "Intent:Open",
url: "market://search?q=" + aURI.scheme,
};
sendMessageToJava(message);
}
}
});
}
}
}
},
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]);

View File

@ -2,4 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
protocol.failed=Couldn't find an application to open this link
protocol.failed=Couldn't find an app to open this link
# A very short string shown in the button toast when no application can open the url
protocol.toast.search=Search