OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 ClientHintsPreferences_h | 5 #ifndef ClientHintsPreferences_h |
6 #define ClientHintsPreferences_h | 6 #define ClientHintsPreferences_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class DocumentLoader; | 13 class Document; |
14 | 14 |
15 class ClientHintsPreferences { | 15 class ClientHintsPreferences { |
16 public: | 16 public: |
17 ClientHintsPreferences() | 17 ClientHintsPreferences() |
18 : m_shouldSendDPR(false) | 18 : m_shouldSendDPR(false) |
19 , m_shouldSendRW(false) | 19 , m_shouldSendResourceWidth(false) |
| 20 , m_shouldSendViewportWidth(false) |
20 { | 21 { |
21 } | 22 } |
22 | 23 |
23 void set(const ClientHintsPreferences& other) | 24 void set(const ClientHintsPreferences& other) |
24 { | 25 { |
25 m_shouldSendDPR = other.m_shouldSendDPR; | 26 m_shouldSendDPR = other.m_shouldSendDPR; |
26 m_shouldSendRW = other.m_shouldSendRW; | 27 m_shouldSendResourceWidth = other.m_shouldSendResourceWidth; |
| 28 m_shouldSendViewportWidth = other.m_shouldSendViewportWidth; |
27 } | 29 } |
28 | 30 |
29 void setShouldSendDPR(bool should) { m_shouldSendDPR = should; } | 31 void setShouldSendDPR(bool should) { m_shouldSendDPR = should; } |
30 void setShouldSendRW(bool should) { m_shouldSendRW = should; } | 32 void setShouldSendResourceWidth(bool should) { m_shouldSendResourceWidth = s
hould; } |
| 33 void setShouldSendViewportWidth(bool should) { m_shouldSendViewportWidth = s
hould; } |
31 bool shouldSendDPR() const { return m_shouldSendDPR; } | 34 bool shouldSendDPR() const { return m_shouldSendDPR; } |
32 bool shouldSendRW() const { return m_shouldSendRW; } | 35 bool shouldSendResourceWidth() const { return m_shouldSendResourceWidth; } |
| 36 bool shouldSendViewportWidth() const { return m_shouldSendViewportWidth; } |
| 37 |
33 private: | 38 private: |
34 bool m_shouldSendDPR; | 39 bool m_shouldSendDPR; |
35 bool m_shouldSendRW; | 40 bool m_shouldSendResourceWidth; |
| 41 bool m_shouldSendViewportWidth; |
36 }; | 42 }; |
37 | 43 |
38 CORE_EXPORT void handleAcceptClientHintsHeader(const String& headerValue, Client
HintsPreferences&); | 44 CORE_EXPORT void handleAcceptClientHintsHeader(const String& headerValue, Client
HintsPreferences&); |
39 } // namespace blink | 45 } // namespace blink |
40 #endif | 46 #endif |
41 | 47 |
OLD | NEW |