OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_COMMON_PREVIEWS_TYPE_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_PREVIEWS_TYPE_H_ |
| 7 |
| 8 #include "content/common/content_export.h" |
| 9 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 10 |
| 11 #define STATIC_ASSERT_PREVIEWS_ENUM(a, b) \ |
| 12 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 13 "mismatching enums: " #a) |
| 14 |
| 15 namespace content { |
| 16 |
| 17 // The Previews state which determines whether to request a Preview version of |
| 18 // the resource. Previews are optimizations that change the format and |
| 19 // content of web pages to improve data savings and / or performance. This enum |
| 20 // determines which Previews types to request. |
| 21 enum PreviewsState { |
| 22 PREVIEWS_UNSPECIFIED = 0, // Let the browser process decide whether or |
| 23 // not to request Preview types. |
| 24 SERVER_LOFI_ON = 1 << 0, // Request a Lo-Fi version of the resource |
| 25 // from the server. |
| 26 CLIENT_LOFI_ON = 1 << 1, // Request a Lo-Fi version of the resource |
| 27 // from the client. |
| 28 PREVIEWS_OFF = 1 << 2, // Request a normal (non-Preview) version of |
| 29 // the resource. |
| 30 PREVIEWS_STATE_LAST = PREVIEWS_OFF |
| 31 }; |
| 32 |
| 33 // Ensure that content::PreviewsState and blink::WebURLRequest::PreviewsState |
| 34 // are kept in sync. |
| 35 STATIC_ASSERT_PREVIEWS_ENUM(PREVIEWS_UNSPECIFIED, |
| 36 blink::WebURLRequest::PreviewsUnspecified); |
| 37 STATIC_ASSERT_PREVIEWS_ENUM(SERVER_LOFI_ON, blink::WebURLRequest::ServerLoFiOn); |
| 38 STATIC_ASSERT_PREVIEWS_ENUM(CLIENT_LOFI_ON, blink::WebURLRequest::ClientLoFiOn); |
| 39 STATIC_ASSERT_PREVIEWS_ENUM(PREVIEWS_OFF, blink::WebURLRequest::PreviewsOff); |
| 40 STATIC_ASSERT_PREVIEWS_ENUM(PREVIEWS_STATE_LAST, |
| 41 blink::WebURLRequest::PreviewsStateLast); |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_PUBLIC_COMMON_PREVIEWS_TYPE_H_ |
OLD | NEW |