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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 CHECK(args->GetString(0, &type_string)); | 1405 CHECK(args->GetString(0, &type_string)); |
1406 std::string mode; | 1406 std::string mode; |
1407 CHECK(args->GetString(1, &mode)); | 1407 CHECK(args->GetString(1, &mode)); |
1408 std::string pattern; | 1408 std::string pattern; |
1409 CHECK(args->GetString(2, &pattern)); | 1409 CHECK(args->GetString(2, &pattern)); |
1410 std::string setting; | 1410 std::string setting; |
1411 CHECK(args->GetString(3, &setting)); | 1411 CHECK(args->GetString(3, &setting)); |
1412 | 1412 |
1413 ContentSettingsType type = ContentSettingsTypeFromGroupName(type_string); | 1413 ContentSettingsType type = ContentSettingsTypeFromGroupName(type_string); |
1414 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION || | 1414 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION || |
1415 type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | |
1416 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM || | 1415 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM || |
1417 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 1416 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
1418 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { | 1417 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { |
1419 NOTREACHED(); | 1418 NOTREACHED(); |
1420 } else { | 1419 } else { |
1421 HostContentSettingsMap* settings_map = | 1420 HostContentSettingsMap* settings_map = |
1422 mode == "normal" ? GetContentSettingsMap() : | 1421 mode == "normal" ? GetContentSettingsMap() : |
1423 GetOTRContentSettingsMap(); | 1422 GetOTRContentSettingsMap(); |
1424 | 1423 |
1425 // The settings map could be null if the mode was OTR but the OTR profile | 1424 // The settings map could be null if the mode was OTR but the OTR profile |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 | 1601 |
1603 // Exceptions apply only when the feature is enabled. | 1602 // Exceptions apply only when the feature is enabled. |
1604 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1603 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1605 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1604 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1606 web_ui()->CallJavascriptFunction( | 1605 web_ui()->CallJavascriptFunction( |
1607 "ContentSettings.enableProtectedContentExceptions", | 1606 "ContentSettings.enableProtectedContentExceptions", |
1608 base::FundamentalValue(enable_exceptions)); | 1607 base::FundamentalValue(enable_exceptions)); |
1609 } | 1608 } |
1610 | 1609 |
1611 } // namespace options | 1610 } // namespace options |
OLD | NEW |