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/content_settings/content_settings_extension_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_extension_provider.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/content_settings_details.h" | 7 #include "chrome/browser/content_settings/content_settings_details.h" |
8 #include "chrome/browser/extensions/extension_content_settings_store.h" | 8 #include "chrome/browser/extensions/extension_content_settings_store.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "content/common/notification_details.h" |
10 #include "content/common/notification_service.h" | 11 #include "content/common/notification_service.h" |
11 #include "content/common/notification_source.h" | 12 #include "content/common/notification_source.h" |
12 | 13 |
13 namespace content_settings { | 14 namespace content_settings { |
14 | 15 |
15 ExtensionProvider::ExtensionProvider( | 16 ExtensionProvider::ExtensionProvider( |
16 Profile* profile, | 17 Profile* profile, |
17 ExtensionContentSettingsStore* extensions_settings, | 18 ExtensionContentSettingsStore* extensions_settings, |
18 bool incognito) | 19 bool incognito) |
19 : profile_(profile), | 20 : profile_(profile), |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 Source<HostContentSettingsMap>(profile_->GetHostContentSettingsMap()), | 63 Source<HostContentSettingsMap>(profile_->GetHostContentSettingsMap()), |
63 Details<const ContentSettingsDetails>(&details)); | 64 Details<const ContentSettingsDetails>(&details)); |
64 } | 65 } |
65 | 66 |
66 void ExtensionProvider::OnContentSettingChanged( | 67 void ExtensionProvider::OnContentSettingChanged( |
67 const std::string& extension_id, | 68 const std::string& extension_id, |
68 bool incognito) { | 69 bool incognito) { |
69 if (incognito_ != incognito) | 70 if (incognito_ != incognito) |
70 return; | 71 return; |
71 // TODO(markusheintz): Be more concise. | 72 // TODO(markusheintz): Be more concise. |
72 NotifyObservers(ContentSettingsDetails( | 73 ContentSettingsDetails details( |
73 ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); | 74 ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, std::string()); |
| 75 NotifyObservers(details); |
74 } | 76 } |
75 | 77 |
76 void ExtensionProvider::OnDestruction() { | 78 void ExtensionProvider::OnDestruction() { |
77 DCHECK(extensions_settings_); | 79 DCHECK(extensions_settings_); |
78 extensions_settings_ = NULL; | 80 extensions_settings_ = NULL; |
79 } | 81 } |
80 | 82 |
81 } // namespace content_settings | 83 } // namespace content_settings |
OLD | NEW |