| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ClientHintsPreferences_h | |
| 6 #define ClientHintsPreferences_h | |
| 7 | |
| 8 #include "core/CoreExport.h" | |
| 9 #include "wtf/Allocator.h" | |
| 10 #include "wtf/text/WTFString.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class CORE_EXPORT ClientHintsPreferences { | |
| 15 DISALLOW_NEW(); | |
| 16 | |
| 17 public: | |
| 18 class Context { | |
| 19 public: | |
| 20 virtual void countClientHintsDPR() = 0; | |
| 21 virtual void countClientHintsResourceWidth() = 0; | |
| 22 virtual void countClientHintsViewportWidth() = 0; | |
| 23 | |
| 24 protected: | |
| 25 virtual ~Context() {} | |
| 26 }; | |
| 27 | |
| 28 ClientHintsPreferences(); | |
| 29 | |
| 30 void updateFrom(const ClientHintsPreferences&); | |
| 31 void updateFromAcceptClientHintsHeader(const String& headerValue, Context*); | |
| 32 | |
| 33 bool shouldSendDPR() const { return m_shouldSendDPR; } | |
| 34 void setShouldSendDPR(bool should) { m_shouldSendDPR = should; } | |
| 35 | |
| 36 bool shouldSendResourceWidth() const { return m_shouldSendResourceWidth; } | |
| 37 void setShouldSendResourceWidth(bool should) { | |
| 38 m_shouldSendResourceWidth = should; | |
| 39 } | |
| 40 | |
| 41 bool shouldSendViewportWidth() const { return m_shouldSendViewportWidth; } | |
| 42 void setShouldSendViewportWidth(bool should) { | |
| 43 m_shouldSendViewportWidth = should; | |
| 44 } | |
| 45 | |
| 46 private: | |
| 47 bool m_shouldSendDPR; | |
| 48 bool m_shouldSendResourceWidth; | |
| 49 bool m_shouldSendViewportWidth; | |
| 50 }; | |
| 51 | |
| 52 } // namespace blink | |
| 53 | |
| 54 #endif | |
| OLD | NEW |