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

Unified Diff: chrome/browser/extensions/api/app/app_api.cc

Issue 11365181: Remove GetExtensionService from Profile. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: replace missing extension_system include Created 8 years, 1 month 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
Index: chrome/browser/extensions/api/app/app_api.cc
diff --git a/chrome/browser/extensions/api/app/app_api.cc b/chrome/browser/extensions/api/app/app_api.cc
index 139ba6abf35d8b9e3e4fce7cd190862099f5da04..3c0a584001a30abfd4848bc19a1f552fc767f3cf 100644
--- a/chrome/browser/extensions/api/app/app_api.cc
+++ b/chrome/browser/extensions/api/app/app_api.cc
@@ -8,6 +8,7 @@
#include "base/values.h"
#include "chrome/browser/extensions/app_notification_manager.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension_constants.h"
#include "googleurl/src/gurl.h"
@@ -43,7 +44,8 @@ bool AppNotifyFunction::RunImpl() {
std::string id = extension_id();
if (details->HasKey(kExtensionIdKey)) {
EXTENSION_FUNCTION_VALIDATE(details->GetString(kExtensionIdKey, &id));
- if (!profile()->GetExtensionService()->GetExtensionById(id, true)) {
+ if (!extensions::ExtensionSystem::Get(profile())->extension_service()->
+ GetExtensionById(id, true)) {
error_ = kInvalidExtensionIdError;
return false;
}
@@ -78,8 +80,8 @@ bool AppNotifyFunction::RunImpl() {
item->set_link_text(link_text);
}
- AppNotificationManager* manager =
- profile()->GetExtensionService()->app_notification_manager();
+ AppNotificationManager* manager = extensions::ExtensionSystem::Get(
+ profile())->extension_service()->app_notification_manager();
// TODO(beaudoin) We should probably report an error if Add returns false.
manager->Add(item.release());
@@ -97,14 +99,15 @@ bool AppClearAllNotificationsFunction::RunImpl() {
DictionaryValue* details = NULL;
if (args_->GetDictionary(0, &details) && details->HasKey(kExtensionIdKey)) {
EXTENSION_FUNCTION_VALIDATE(details->GetString(kExtensionIdKey, &id));
- if (!profile()->GetExtensionService()->GetExtensionById(id, true)) {
+ if (!extensions::ExtensionSystem::Get(profile())->extension_service()->
+ GetExtensionById(id, true)) {
error_ = kInvalidExtensionIdError;
return false;
}
}
- AppNotificationManager* manager =
- profile()->GetExtensionService()->app_notification_manager();
+ AppNotificationManager* manager = extensions::ExtensionSystem::Get(
+ profile())->extension_service()->app_notification_manager();
manager->ClearAll(id);
return true;
}
« no previous file with comments | « chrome/browser/extensions/all_urls_apitest.cc ('k') | chrome/browser/extensions/api/content_settings/content_settings_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698