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

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

Issue 6803012: Profile shouldn't own DesktopNotificationService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 3c631d205e58bb2969a3b4c941b2d82982867bd4..6bbab5587dfc78a1bf61ecd0a70357d7c583dac9 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -13,6 +13,7 @@
#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"
@@ -375,8 +376,8 @@ std::string ContentSettingsHandler::GetSettingDefaultFromModel(
default_setting = web_ui_->GetProfile()->
GetGeolocationContentSettingsMap()->GetDefaultContentSetting();
} else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- default_setting = web_ui_->GetProfile()->
- GetDesktopNotificationService()->GetDefaultContentSetting();
+ default_setting = DesktopNotificationServiceFactory::GetForProfile(
+ web_ui_->GetProfile())->GetDefaultContentSetting();
} else {
default_setting = GetContentSettingsMap()->GetDefaultContentSetting(type);
}
@@ -390,8 +391,8 @@ bool ContentSettingsHandler::GetDefaultSettingManagedFromModel(
return web_ui_->GetProfile()->
GetGeolocationContentSettingsMap()->IsDefaultContentSettingManaged();
} else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- return web_ui_->GetProfile()->
- GetDesktopNotificationService()->IsDefaultContentSettingManaged();
+ return DesktopNotificationServiceFactory::GetForProfile(
+ web_ui_->GetProfile())->IsDefaultContentSettingManaged();
} else {
return GetContentSettingsMap()->IsDefaultContentSettingManaged(type);
}
@@ -491,7 +492,7 @@ void ContentSettingsHandler::UpdateGeolocationExceptionsView() {
void ContentSettingsHandler::UpdateNotificationExceptionsView() {
DesktopNotificationService* service =
- web_ui_->GetProfile()->GetDesktopNotificationService();
+ DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile());
std::vector<GURL> allowed(service->GetAllowedOrigins());
std::vector<GURL> blocked(service->GetBlockedOrigins());
@@ -590,7 +591,7 @@ void ContentSettingsHandler::SetContentFilter(const ListValue* args) {
web_ui_->GetProfile()->GetGeolocationContentSettingsMap()->
SetDefaultContentSetting(default_setting);
} else if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
- web_ui_->GetProfile()->GetDesktopNotificationService()->
+ DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
SetDefaultContentSetting(default_setting);
} else {
GetContentSettingsMap()->
@@ -632,11 +633,11 @@ void ContentSettingsHandler::RemoveException(const ListValue* args) {
DCHECK(rv);
ContentSetting content_setting = ContentSettingFromString(setting);
if (content_setting == CONTENT_SETTING_ALLOW) {
- web_ui_->GetProfile()->GetDesktopNotificationService()->
+ DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
ResetAllowedOrigin(GURL(origin));
} else {
DCHECK_EQ(content_setting, CONTENT_SETTING_BLOCK);
- web_ui_->GetProfile()->GetDesktopNotificationService()->
+ DesktopNotificationServiceFactory::GetForProfile(web_ui_->GetProfile())->
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