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/ui/webui/options/content_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 scoped_ptr<base::DictionaryValue> exception(new base::DictionaryValue); | 1048 scoped_ptr<base::DictionaryValue> exception(new base::DictionaryValue); |
1049 switch (i->mode) { | 1049 switch (i->mode) { |
1050 case content::HostZoomMap::ZOOM_CHANGED_FOR_HOST: { | 1050 case content::HostZoomMap::ZOOM_CHANGED_FOR_HOST: { |
1051 exception->SetString(kOrigin, i->host); | 1051 exception->SetString(kOrigin, i->host); |
1052 std::string host = i->host; | 1052 std::string host = i->host; |
1053 if (host == content::kUnreachableWebDataURL) { | 1053 if (host == content::kUnreachableWebDataURL) { |
1054 host = | 1054 host = |
1055 l10n_util::GetStringUTF8(IDS_ZOOMLEVELS_CHROME_ERROR_PAGES_LABEL); | 1055 l10n_util::GetStringUTF8(IDS_ZOOMLEVELS_CHROME_ERROR_PAGES_LABEL); |
1056 } | 1056 } |
1057 exception->SetString(kOrigin, host); | 1057 exception->SetString(kOrigin, host); |
| 1058 break; |
1058 } | 1059 } |
1059 case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: | 1060 case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: |
1060 // These are not stored in preferences and get cleared on next browser | 1061 // These are not stored in preferences and get cleared on next browser |
1061 // start. Therefore, we don't care for them. | 1062 // start. Therefore, we don't care for them. |
1062 continue; | 1063 continue; |
1063 case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: | 1064 case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: |
1064 NOTREACHED(); | 1065 NOTREACHED(); |
1065 } | 1066 } |
1066 exception->SetString(kSetting, | 1067 exception->SetString(kSetting, |
1067 ContentSettingToString(CONTENT_SETTING_DEFAULT)); | 1068 ContentSettingToString(CONTENT_SETTING_DEFAULT)); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 | 1585 |
1585 // Exceptions apply only when the feature is enabled. | 1586 // Exceptions apply only when the feature is enabled. |
1586 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1587 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1587 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1588 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1588 web_ui()->CallJavascriptFunction( | 1589 web_ui()->CallJavascriptFunction( |
1589 "ContentSettings.enableProtectedContentExceptions", | 1590 "ContentSettings.enableProtectedContentExceptions", |
1590 base::FundamentalValue(enable_exceptions)); | 1591 base::FundamentalValue(enable_exceptions)); |
1591 } | 1592 } |
1592 | 1593 |
1593 } // namespace options | 1594 } // namespace options |
OLD | NEW |