| 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_utils.h" | 5 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/string_split.h" | 12 #include "base/string_split.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // True if a given content settings type requires additional resource | 17 // True if a given content settings type requires additional resource |
| 18 // identifiers. | 18 // identifiers. |
| 19 const bool kRequiresResourceIdentifier[CONTENT_SETTINGS_NUM_TYPES] = { | 19 const bool kRequiresResourceIdentifier[CONTENT_SETTINGS_NUM_TYPES] = { |
| 20 false, // CONTENT_SETTINGS_TYPE_COOKIES | 20 false, // CONTENT_SETTINGS_TYPE_COOKIES |
| 21 false, // CONTENT_SETTINGS_TYPE_IMAGES | 21 false, // CONTENT_SETTINGS_TYPE_IMAGES |
| 22 false, // CONTENT_SETTINGS_TYPE_JAVASCRIPT | 22 false, // CONTENT_SETTINGS_TYPE_JAVASCRIPT |
| 23 true, // CONTENT_SETTINGS_TYPE_PLUGINS | 23 true, // CONTENT_SETTINGS_TYPE_PLUGINS |
| 24 false, // CONTENT_SETTINGS_TYPE_POPUPS | 24 false, // CONTENT_SETTINGS_TYPE_POPUPS |
| 25 false, // Not used for Geolocation | 25 false, // Not used for Geolocation |
| 26 false, // Not used for Notifications | 26 false, // Not used for Notifications |
| 27 false, // Not used for Intents. |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 const char* kPatternSeparator = ","; | 30 const char* kPatternSeparator = ","; |
| 30 | 31 |
| 31 } // namespace | 32 } // namespace |
| 32 | 33 |
| 33 namespace content_settings { | 34 namespace content_settings { |
| 34 | 35 |
| 35 bool RequiresResourceIdentifier(ContentSettingsType content_type) { | 36 bool RequiresResourceIdentifier(ContentSettingsType content_type) { |
| 36 if (CommandLine::ForCurrentProcess()->HasSwitch( | 37 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return pattern_pair; | 92 return pattern_pair; |
| 92 } | 93 } |
| 93 | 94 |
| 94 ContentSetting ValueToContentSetting(Value* value) { | 95 ContentSetting ValueToContentSetting(Value* value) { |
| 95 int int_value; | 96 int int_value; |
| 96 value->GetAsInteger(&int_value); | 97 value->GetAsInteger(&int_value); |
| 97 return IntToContentSetting(int_value); | 98 return IntToContentSetting(int_value); |
| 98 } | 99 } |
| 99 | 100 |
| 100 } // namespace content_settings | 101 } // namespace content_settings |
| OLD | NEW |