Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3292)

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/notifications/notification_options_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 8a05b621d62f9d932f4e9c307984af28fd9561df..1207ea8ea75c64822752aeb809284628620750f5 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -40,12 +40,14 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "net/base/escape.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
using WebKit::WebNotificationPresenter;
using WebKit::WebTextDirection;
+using WebKit::WebSecurityOrigin;
const ContentSetting kDefaultSetting = CONTENT_SETTING_ASK;
@@ -406,9 +408,14 @@ string16 DesktopNotificationService::DisplayNameForOrigin(
const GURL& origin) {
// If the source is an extension, lookup the display name.
if (origin.SchemeIs(chrome::kExtensionScheme)) {
- ExtensionService* ext_service = profile_->GetExtensionService();
- if (ext_service) {
- const Extension* extension = ext_service->GetExtensionByURL(origin);
+ ExtensionService* extension_service = profile_->GetExtensionService();
+ if (extension_service) {
+ const Extension* extension =
+ extension_service->extensions()->GetExtensionOrAppByURL(
+ ExtensionURLInfo(
+ WebSecurityOrigin::createFromString(
+ UTF8ToUTF16(origin.spec())),
+ origin));
if (extension)
return UTF8ToUTF16(extension->name());
}
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/notifications/notification_options_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698