| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_COMMON_CONTENT_SETTINGS_H_ | 5 #ifndef CHROME_COMMON_CONTENT_SETTINGS_H_ |
| 6 #define CHROME_COMMON_CONTENT_SETTINGS_H_ | 6 #define CHROME_COMMON_CONTENT_SETTINGS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/tuple.h" |
| 13 |
| 14 #include "chrome/common/content_settings_pattern.h" |
| 9 #include "chrome/common/content_settings_types.h" | 15 #include "chrome/common/content_settings_types.h" |
| 10 | 16 |
| 11 // Different settings that can be assigned for a particular content type. We | 17 // Different settings that can be assigned for a particular content type. We |
| 12 // give the user the ability to set these on a global and per-host basis. | 18 // give the user the ability to set these on a global and per-host basis. |
| 13 enum ContentSetting { | 19 enum ContentSetting { |
| 14 CONTENT_SETTING_DEFAULT = 0, | 20 CONTENT_SETTING_DEFAULT = 0, |
| 15 CONTENT_SETTING_ALLOW, | 21 CONTENT_SETTING_ALLOW, |
| 16 CONTENT_SETTING_BLOCK, | 22 CONTENT_SETTING_BLOCK, |
| 17 CONTENT_SETTING_ASK, | 23 CONTENT_SETTING_ASK, |
| 18 CONTENT_SETTING_SESSION_ONLY, | 24 CONTENT_SETTING_SESSION_ONLY, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 } | 37 } |
| 32 | 38 |
| 33 explicit ContentSettings(ContentSetting default_setting) { | 39 explicit ContentSettings(ContentSetting default_setting) { |
| 34 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) | 40 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) |
| 35 settings[i] = default_setting; | 41 settings[i] = default_setting; |
| 36 } | 42 } |
| 37 | 43 |
| 38 ContentSetting settings[CONTENT_SETTINGS_NUM_TYPES]; | 44 ContentSetting settings[CONTENT_SETTINGS_NUM_TYPES]; |
| 39 }; | 45 }; |
| 40 | 46 |
| 47 struct ContentSettingPatternSource { |
| 48 ContentSettingPatternSource(const ContentSettingsPattern& primary_pattern, |
| 49 const ContentSettingsPattern& secondary_patttern, |
| 50 ContentSetting setting, |
| 51 const std::string& source, |
| 52 bool incognito); |
| 53 ContentSettingPatternSource(); |
| 54 ContentSettingsPattern primary_pattern; |
| 55 ContentSettingsPattern secondary_pattern; |
| 56 ContentSetting setting; |
| 57 std::string source; |
| 58 bool incognito; |
| 59 }; |
| 60 |
| 61 typedef std::vector<ContentSettingPatternSource> ContentSettingsForOneType; |
| 62 |
| 41 #endif // CHROME_COMMON_CONTENT_SETTINGS_H_ | 63 #endif // CHROME_COMMON_CONTENT_SETTINGS_H_ |
| OLD | NEW |