| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ |
| 7 | 7 |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Website setting which stores the list of client hints (and the preference | 78 // Website setting which stores the list of client hints (and the preference |
| 79 // expiration time for each of the client hints) that the origin requested | 79 // expiration time for each of the client hints) that the origin requested |
| 80 // the browser to remember. Spec: | 80 // the browser to remember. Spec: |
| 81 // http://httpwg.org/http-extensions/client-hints.html#accept-ch-lifetime. | 81 // http://httpwg.org/http-extensions/client-hints.html#accept-ch-lifetime. |
| 82 // The setting is stored as a dictionary that includes the mapping from | 82 // The setting is stored as a dictionary that includes the mapping from |
| 83 // different client hints to their respective expiration times (seconds since | 83 // different client hints to their respective expiration times (seconds since |
| 84 // epoch). The browser is expected to send all the unexpired client hints in | 84 // epoch). The browser is expected to send all the unexpired client hints in |
| 85 // the HTTP request headers for every resource requested from that origin. | 85 // the HTTP request headers for every resource requested from that origin. |
| 86 CONTENT_SETTINGS_TYPE_CLIENT_HINTS, | 86 CONTENT_SETTINGS_TYPE_CLIENT_HINTS, |
| 87 | 87 |
| 88 // Generic Sensor API covering ambient-light-sensor, accelerometer, gyroscope |
| 89 // and magnetometer are all mapped to a single content_settings_type. |
| 90 // Setting for the Generic Sensor API covering ambient-light-sensor, |
| 91 // accelerometer, gyroscope and magnetometer. These are all mapped to a single |
| 92 // ContentSettingsType. |
| 93 CONTENT_SETTINGS_TYPE_SENSORS, |
| 94 |
| 88 CONTENT_SETTINGS_NUM_TYPES, | 95 CONTENT_SETTINGS_NUM_TYPES, |
| 89 }; | 96 }; |
| 90 | 97 |
| 91 struct ContentSettingsTypeHash { | 98 struct ContentSettingsTypeHash { |
| 92 std::size_t operator()(ContentSettingsType type) const { | 99 std::size_t operator()(ContentSettingsType type) const { |
| 93 return static_cast<std::size_t>(type); | 100 return static_cast<std::size_t>(type); |
| 94 } | 101 } |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ | 104 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_TYPES_H_ |
| OLD | NEW |