Bug 825505 - Allow cancelling pinning sites from the Awesomescreen. r=mfinkle

This commit is contained in:
Wes Johnston 2013-01-02 11:49:41 -08:00
parent bc1410bc83
commit f5966d3f6d

View File

@ -24,6 +24,7 @@ import org.json.JSONObject;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.OnAccountsUpdateListener;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@ -980,6 +981,9 @@ public class AboutHomeContent extends ScrollView
int requestCode = GeckoAppShell.sActivityHelper.makeRequestCode(new ActivityResultHandler() {
public void onActivityResult(int resultCode, Intent data) {
if (resultCode == Activity.RESULT_CANCELED || data == null)
return;
final String title = data.getStringExtra(AwesomeBar.TITLE_KEY);
final String url = data.getStringExtra(AwesomeBar.URL_KEY);
@ -988,7 +992,6 @@ public class AboutHomeContent extends ScrollView
@Override
public Void doInBackground(Void... params) {
final ContentResolver resolver = mActivity.getContentResolver();
Log.i(LOGTAG, "Pin : " + url + " and " + title);
BrowserDB.pinSite(resolver, url, (title == null ? url : title), position);
return null;
}