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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 host = | 1065 host = |
1066 l10n_util::GetStringUTF8(IDS_ZOOMLEVELS_CHROME_ERROR_PAGES_LABEL); | 1066 l10n_util::GetStringUTF8(IDS_ZOOMLEVELS_CHROME_ERROR_PAGES_LABEL); |
1067 } | 1067 } |
1068 exception->SetString(kOrigin, host); | 1068 exception->SetString(kOrigin, host); |
1069 break; | 1069 break; |
1070 } | 1070 } |
1071 case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: | 1071 case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: |
1072 // These are not stored in preferences and get cleared on next browser | 1072 // These are not stored in preferences and get cleared on next browser |
1073 // start. Therefore, we don't care for them. | 1073 // start. Therefore, we don't care for them. |
1074 continue; | 1074 continue; |
| 1075 case content::HostZoomMap::PAGE_SCALE_IS_ONE_CHANGED: |
| 1076 continue; |
1075 case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: | 1077 case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: |
1076 NOTREACHED(); | 1078 NOTREACHED(); |
1077 } | 1079 } |
1078 exception->SetString(kSetting, | 1080 exception->SetString(kSetting, |
1079 ContentSettingToString(CONTENT_SETTING_DEFAULT)); | 1081 ContentSettingToString(CONTENT_SETTING_DEFAULT)); |
1080 | 1082 |
1081 // Calculate the zoom percent from the factor. Round up to the nearest whole | 1083 // Calculate the zoom percent from the factor. Round up to the nearest whole |
1082 // number. | 1084 // number. |
1083 int zoom_percent = static_cast<int>( | 1085 int zoom_percent = static_cast<int>( |
1084 content::ZoomLevelToZoomFactor(i->zoom_level) * 100 + 0.5); | 1086 content::ZoomLevelToZoomFactor(i->zoom_level) * 100 + 0.5); |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 | 1601 |
1600 // Exceptions apply only when the feature is enabled. | 1602 // Exceptions apply only when the feature is enabled. |
1601 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1603 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1602 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1604 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1603 web_ui()->CallJavascriptFunction( | 1605 web_ui()->CallJavascriptFunction( |
1604 "ContentSettings.enableProtectedContentExceptions", | 1606 "ContentSettings.enableProtectedContentExceptions", |
1605 base::FundamentalValue(enable_exceptions)); | 1607 base::FundamentalValue(enable_exceptions)); |
1606 } | 1608 } |
1607 | 1609 |
1608 } // namespace options | 1610 } // namespace options |
OLD | NEW |