Bug 869123: Fix setIntent() call in ActionProvider. [r=mfinkle]

--HG--
extra : rebase_source : 413831c09b3df15383ba07671468af999e89134d
This commit is contained in:
Sriram Ramasubramanian 2013-06-04 14:07:42 -07:00
parent 09fcd73c21
commit 4f6c161558
2 changed files with 15 additions and 3 deletions

View File

@ -1542,9 +1542,16 @@ abstract public class BrowserApp extends GeckoApp
if (Build.VERSION.SDK_INT >= 14) {
GeckoActionProvider provider = (GeckoActionProvider) share.getActionProvider();
if (provider != null) {
Intent shareIntent = GeckoAppShell.getShareIntent(this, url,
"text/plain", tab.getDisplayTitle());
provider.setIntent(shareIntent);
Intent shareIntent = provider.getIntent();
if (shareIntent == null) {
shareIntent = GeckoAppShell.getShareIntent(this, url,
"text/plain", tab.getDisplayTitle());
provider.setIntent(shareIntent);
} else {
shareIntent.putExtra(Intent.EXTRA_TEXT, url);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, tab.getDisplayTitle());
}
}
}

View File

@ -101,6 +101,11 @@ public class GeckoActionProvider extends ActionProvider {
mHistoryFileName = historyFile;
}
public Intent getIntent() {
ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
return dataModel.getIntent();
}
public void setIntent(Intent intent) {
ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
dataModel.setIntent(intent);