15 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_DEVICE_PROPERTIES_H_
16 #define NET_INSTAWEB_REWRITER_PUBLIC_DEVICE_PROPERTIES_H_
24 #include "pagespeed/kernel/http/user_agent_matcher.h"
26 namespace net_instaweb {
37 void SetUserAgent(
const StringPiece& user_agent_string);
41 bool SupportsImageInlining()
const;
42 bool SupportsLazyloadImages()
const;
43 bool SupportsCriticalCss()
const;
44 bool SupportsCriticalImagesBeacon()
const;
45 bool SupportsJsDefer(
bool enable_mobile)
const;
57 bool SupportsWebpLosslessAlpha()
const;
58 bool SupportsWebpAnimated()
const;
60 bool AcceptsGzip()
const;
62 bool IsMobile()
const {
63 return GetDeviceType() == UserAgentMatcher::kMobile;
65 bool IsTablet()
const {
66 return GetDeviceType() == UserAgentMatcher::kTablet;
79 static const int kMediumScreenWidthThreshold = 720;
80 static const int kLargeScreenWidthThreshold = 1500;
81 bool ForbidWebpInlining()
const;
83 bool RequestsSaveData()
const;
84 bool HasViaHeader()
const;
87 friend class ImageRewriteTest;
94 mutable LazyBool supports_critical_css_;
95 mutable LazyBool supports_image_inlining_;
97 mutable LazyBool supports_lazyload_images_;
98 mutable LazyBool requests_save_data_;
101 mutable LazyBool supports_webp_rewritten_urls_;
102 mutable LazyBool supports_webp_lossless_alpha_;
103 mutable LazyBool supports_webp_animated_;
105 mutable LazyBool is_mobile_user_agent_;
106 mutable LazyBool supports_split_html_;
107 mutable LazyBool supports_flush_early_;
108 const std::vector<int>* preferred_webp_qualities_;
109 const std::vector<int>* preferred_jpeg_qualities_;
ImageQualityPreference
Definition: device_properties.h:69
Definition: user_agent_matcher.h:43
bool SupportsWebpInPlace() const
The request asks for high image quality.
Definition: device_properties.h:77
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
The request asks for low image quality.
Definition: device_properties.h:73
Definition: device_properties.h:32
Server uses its own default image quality.
Definition: device_properties.h:71
LazyBool
Lazily-initialized boolean value.
Definition: basictypes.h:68
The request asks for medium image quality.
Definition: device_properties.h:75
bool SupportsWebpRewrittenUrls() const
DeviceType
Definition: user_agent_matcher.h:49
void ParseRequestHeaders(const RequestHeaders &request_headers)
Definition: request_properties.h:37