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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 6813116: Revert 81277 - Profile shouldn't own DesktopNotificationService.DesktopNotificationService is now... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 months 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/ui/options/options_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/content_settings_handler.cc
===================================================================
--- chrome/browser/ui/webui/options/content_settings_handler.cc (revision 81278)
+++ chrome/browser/ui/webui/options/content_settings_handler.cc (working copy)
@@ -13,7 +13,6 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/geolocation/geolocation_content_settings_map.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
-#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/chrome_switches.h"
@@ -376,8 +375,8 @@
default_setting = web_ui_->GetProfile()->
GetGeolocationContentSettingsMap()->GetDefaultContentSetting();
} else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- default_setting = DesktopNotificationServiceFactory::GetForProfile(
- web_ui_->GetProfile())->GetDefaultContentSetting();
+ default_setting = web_ui_->GetProfile()->
+ GetDesktopNotificationService()->GetDefaultContentSetting();
} else {
default_setting = GetContentSettingsMap()->GetDefaultContentSetting(type);
}
@@ -391,8 +390,8 @@
return web_ui_->GetProfile()->
GetGeolocationContentSettingsMap()->IsDefaultContentSettingManaged();
} else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- return DesktopNotificationServiceFactory::GetForProfile(
- web_ui_->GetProfile())->IsDefaultContentSettingManaged();
+ return web_ui_->GetProfile()->
+ GetDesktopNotificationService()->IsDefaultContentSettingManaged();
} else {
return GetContentSettingsMap()->IsDefaultContentSettingManaged(type);
}
@@ -492,7 +491,7 @@
void ContentSettingsHandler::UpdateNotificationExceptionsView() {
DesktopNotificationService* service =
- DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile());
+ web_ui_->GetProfile()->GetDesktopNotificationService();
std::vector<GURL> allowed(service->GetAllowedOrigins());
std::vector<GURL> blocked(service->GetBlockedOrigins());
@@ -591,7 +590,7 @@
web_ui_->GetProfile()->GetGeolocationContentSettingsMap()->
SetDefaultContentSetting(default_setting);
} else if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
+ web_ui_->GetProfile()->GetDesktopNotificationService()->
SetDefaultContentSetting(default_setting);
} else {
GetContentSettingsMap()->
@@ -633,11 +632,11 @@
DCHECK(rv);
ContentSetting content_setting = ContentSettingFromString(setting);
if (content_setting == CONTENT_SETTING_ALLOW) {
- DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
+ web_ui_->GetProfile()->GetDesktopNotificationService()->
ResetAllowedOrigin(GURL(origin));
} else {
DCHECK_EQ(content_setting, CONTENT_SETTING_BLOCK);
- DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
+ web_ui_->GetProfile()->GetDesktopNotificationService()->
ResetBlockedOrigin(GURL(origin));
}
} else {
« no previous file with comments | « chrome/browser/ui/options/options_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698