| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/content_settings/content_settings_api.h" | 5 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 CookieSettings* cookie_settings; | 136 CookieSettings* cookie_settings; |
| 137 if (incognito) { | 137 if (incognito) { |
| 138 if (!profile()->HasOffTheRecordProfile()) { | 138 if (!profile()->HasOffTheRecordProfile()) { |
| 139 // TODO(bauerb): Allow reading incognito content settings | 139 // TODO(bauerb): Allow reading incognito content settings |
| 140 // outside of an incognito session. | 140 // outside of an incognito session. |
| 141 error_ = keys::kIncognitoSessionOnlyError; | 141 error_ = keys::kIncognitoSessionOnlyError; |
| 142 return false; | 142 return false; |
| 143 } | 143 } |
| 144 map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 144 map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
| 145 cookie_settings = CookieSettings::Factory::GetForProfile( | 145 cookie_settings = CookieSettings::Factory::GetForProfile( |
| 146 profile()->GetOffTheRecordProfile()); | 146 profile()->GetOffTheRecordProfile()).get(); |
| 147 } else { | 147 } else { |
| 148 map = profile()->GetHostContentSettingsMap(); | 148 map = profile()->GetHostContentSettingsMap(); |
| 149 cookie_settings = CookieSettings::Factory::GetForProfile(profile()); | 149 cookie_settings = CookieSettings::Factory::GetForProfile(profile()).get(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 ContentSetting setting; | 152 ContentSetting setting; |
| 153 if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { | 153 if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { |
| 154 // TODO(jochen): Do we return the value for setting or for reading cookies? | 154 // TODO(jochen): Do we return the value for setting or for reading cookies? |
| 155 bool setting_cookie = false; | 155 bool setting_cookie = false; |
| 156 setting = cookie_settings->GetCookieSetting(primary_url, secondary_url, | 156 setting = cookie_settings->GetCookieSetting(primary_url, secondary_url, |
| 157 setting_cookie, NULL); | 157 setting_cookie, NULL); |
| 158 } else { | 158 } else { |
| 159 setting = map->GetContentSetting(primary_url, secondary_url, content_type, | 159 setting = map->GetContentSetting(primary_url, secondary_url, content_type, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 true)); | 297 true)); |
| 298 } | 298 } |
| 299 | 299 |
| 300 // static | 300 // static |
| 301 void ContentSettingsContentSettingGetResourceIdentifiersFunction:: | 301 void ContentSettingsContentSettingGetResourceIdentifiersFunction:: |
| 302 SetPluginsForTesting(const std::vector<webkit::WebPluginInfo>* plugins) { | 302 SetPluginsForTesting(const std::vector<webkit::WebPluginInfo>* plugins) { |
| 303 g_testing_plugins_ = plugins; | 303 g_testing_plugins_ = plugins; |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace extensions | 306 } // namespace extensions |
| OLD | NEW |