| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/notifications/desktop_notification_service.h" | 21 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 22 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 22 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/browser_list.h" | 24 #include "chrome/browser/ui/browser_list.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/content_settings_pattern.h" | 27 #include "chrome/common/content_settings_pattern.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "content/browser/tab_contents/tab_contents.h" | 30 #include "content/browser/tab_contents/tab_contents.h" |
| 31 #include "content/common/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
| 33 #include "content/public/browser/notification_types.h" | 33 #include "content/public/browser/notification_types.h" |
| 34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
| 35 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 36 #include "grit/locale_settings.h" | 36 #include "grit/locale_settings.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 struct ContentSettingsTypeNameEntry { | 41 struct ContentSettingsTypeNameEntry { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 CommandLine::ForCurrentProcess()->HasSwitch( | 270 CommandLine::ForCurrentProcess()->HasSwitch( |
| 271 switches::kEnableClickToPlay)); | 271 switches::kEnableClickToPlay)); |
| 272 localized_strings->SetBoolean("enable_web_intents", | 272 localized_strings->SetBoolean("enable_web_intents", |
| 273 CommandLine::ForCurrentProcess()->HasSwitch( | 273 CommandLine::ForCurrentProcess()->HasSwitch( |
| 274 switches::kEnableWebIntents)); | 274 switches::kEnableWebIntents)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ContentSettingsHandler::Initialize() { | 277 void ContentSettingsHandler::Initialize() { |
| 278 notification_registrar_.Add( | 278 notification_registrar_.Add( |
| 279 this, chrome::NOTIFICATION_PROFILE_CREATED, | 279 this, chrome::NOTIFICATION_PROFILE_CREATED, |
| 280 NotificationService::AllSources()); | 280 content::NotificationService::AllSources()); |
| 281 notification_registrar_.Add( | 281 notification_registrar_.Add( |
| 282 this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 282 this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 283 NotificationService::AllSources()); | 283 content::NotificationService::AllSources()); |
| 284 | 284 |
| 285 UpdateHandlersEnabledRadios(); | 285 UpdateHandlersEnabledRadios(); |
| 286 UpdateAllExceptionsViewsFromModel(); | 286 UpdateAllExceptionsViewsFromModel(); |
| 287 notification_registrar_.Add( | 287 notification_registrar_.Add( |
| 288 this, chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED, | 288 this, chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED, |
| 289 NotificationService::AllSources()); | 289 content::NotificationService::AllSources()); |
| 290 notification_registrar_.Add( | 290 notification_registrar_.Add( |
| 291 this, chrome::NOTIFICATION_DESKTOP_NOTIFICATION_SETTINGS_CHANGED, | 291 this, chrome::NOTIFICATION_DESKTOP_NOTIFICATION_SETTINGS_CHANGED, |
| 292 NotificationService::AllSources()); | 292 content::NotificationService::AllSources()); |
| 293 Profile* profile = Profile::FromWebUI(web_ui_); | 293 Profile* profile = Profile::FromWebUI(web_ui_); |
| 294 notification_registrar_.Add( | 294 notification_registrar_.Add( |
| 295 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, | 295 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, |
| 296 content::Source<Profile>(profile)); | 296 content::Source<Profile>(profile)); |
| 297 | 297 |
| 298 PrefService* prefs = profile->GetPrefs(); | 298 PrefService* prefs = profile->GetPrefs(); |
| 299 pref_change_registrar_.Init(prefs); | 299 pref_change_registrar_.Init(prefs); |
| 300 pref_change_registrar_.Add(prefs::kGeolocationContentSettings, this); | 300 pref_change_registrar_.Add(prefs::kGeolocationContentSettings, this); |
| 301 } | 301 } |
| 302 | 302 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); | 798 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); |
| 799 } | 799 } |
| 800 | 800 |
| 801 HostContentSettingsMap* | 801 HostContentSettingsMap* |
| 802 ContentSettingsHandler::GetOTRContentSettingsMap() { | 802 ContentSettingsHandler::GetOTRContentSettingsMap() { |
| 803 Profile* profile = Profile::FromWebUI(web_ui_); | 803 Profile* profile = Profile::FromWebUI(web_ui_); |
| 804 if (profile->HasOffTheRecordProfile()) | 804 if (profile->HasOffTheRecordProfile()) |
| 805 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 805 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
| 806 return NULL; | 806 return NULL; |
| 807 } | 807 } |
| OLD | NEW |