From 5845c4644a2919a7868d7a6d1a6e3c7596f0f07c Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Wed, 18 Jul 2012 14:18:46 -0700 Subject: [PATCH 001/118] Bug 769594: Make nsObjectLoadingContent use TestPermissionFromPrincipal. r=mounir --- content/base/src/nsObjectLoadingContent.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 0e9ab52566c..bd9b423f3a1 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -496,19 +496,24 @@ nsresult nsObjectLoadingContent::IsPluginEnabledForType(const nsCString& aMIMETy rv = topWindow->GetDocument(getter_AddRefs(topDocument)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr topDoc = do_QueryInterface(topDocument); - nsIURI* topUri = topDoc->GetDocumentURI(); nsCOMPtr permissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - PRUint32 permission; - rv = permissionManager->TestPermission(topUri, "plugins", &permission); - NS_ENSURE_SUCCESS(rv, rv); + bool allowPerm = false; + if (!nsContentUtils::IsSystemPrincipal(topDoc->NodePrincipal())) { + PRUint32 permission; + rv = permissionManager->TestPermissionFromPrincipal(topDoc->NodePrincipal(), + "plugins", + &permission); + NS_ENSURE_SUCCESS(rv, rv); + allowPerm = permission == nsIPermissionManager::ALLOW_ACTION; + } PRUint32 state; rv = pluginHost->GetBlocklistStateForType(aMIMEType.get(), &state); NS_ENSURE_SUCCESS(rv, rv); - if (permission == nsIPermissionManager::ALLOW_ACTION && + if (allowPerm && state != nsIBlocklistService::STATE_VULNERABLE_UPDATE_AVAILABLE && state != nsIBlocklistService::STATE_VULNERABLE_NO_UPDATE) { mCTPPlayable = true; From 14a82646a545f5ae7032b2681153210f14694299 Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Wed, 18 Jul 2012 11:40:05 -0700 Subject: [PATCH 002/118] Bug 755136: implement social sidebar, r=gavin --HG-- extra : rebase_source : 5545f8120d9fc3cea168007bbedde7ba30efdaa9 --- browser/app/profile/firefox.js | 3 +- browser/base/content/browser-sets.inc | 2 + browser/base/content/browser-social.js | 65 ++++- browser/base/content/browser.xul | 17 ++ browser/base/content/test/Makefile.in | 1 + .../base/content/test/browser_shareButton.js | 1 - .../content/test/browser_social_sidebar.js | 74 ++++++ .../content/test/browser_social_toolbar.js | 11 +- .../locales/en-US/chrome/browser/browser.dtd | 2 + browser/modules/Social.jsm | 9 +- toolkit/components/social/SocialService.jsm | 224 +++++++++--------- 11 files changed, 284 insertions(+), 125 deletions(-) create mode 100644 browser/base/content/test/browser_social_sidebar.js diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 1616359f358..0107c6600d4 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1184,4 +1184,5 @@ pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false); pref("image.mem.max_decoded_image_kb", 256000); // Example social provider -pref("social.manifest.motown", "{\"origin\":\"https://motown-dev.mozillalabs.com\",\"name\":\"MoTown\",\"workerURL\":\"https://motown-dev.mozillalabs.com/social/worker.js\",\"iconURL\":\"https://motown-dev.mozillalabs.com/images/motown-icon.png\"}"); +pref("social.manifest.motown", "{\"origin\":\"https://motown-dev.mozillalabs.com\",\"name\":\"MoTown\",\"workerURL\":\"https://motown-dev.mozillalabs.com/social/worker.js\",\"iconURL\":\"https://motown-dev.mozillalabs.com/images/motown-icon.png\",\"sidebarURL\":\"https://motown-dev.mozillalabs.com/social/sidebar\"}"); +pref("social.sidebar.open", true); diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index 4d8404ef59b..649526c09d5 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -107,6 +107,7 @@ + @@ -181,6 +182,7 @@ #endif +