Page Speed Optimization Libraries  1.6.29.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
net_instaweb::DeviceProperties Class Reference

#include "device_properties.h"

List of all members.

Public Types

enum  ImageQualityPreference { kImageQualityDefault, kImageQualityLow, kImageQualityMedium, kImageQualityHigh }

Public Member Functions

 DeviceProperties (UserAgentMatcher *matcher)
void set_user_agent (const StringPiece &user_agent_string)
bool SupportsImageInlining () const
bool SupportsLazyloadImages () const
bool SupportsCriticalImagesBeacon () const
bool SupportsJsDefer (bool enable_mobile) const
bool SupportsWebp () const
bool SupportsWebpLosslessAlpha () const
bool IsBot () const
bool SupportsSplitHtml (bool enable_mobile) const
bool CanPreloadResources () const
bool GetScreenResolution (int *width, int *height) const
UserAgentMatcher::DeviceType GetDeviceType () const
bool IsMobile () const
void SetPreferredImageQualities (const std::vector< int > *webp, const std::vector< int > *jpeg)
bool GetPreferredImageQualities (ImageQualityPreference preference, int *webp, int *jpeg) const
 Returns true iff WebP and Jpeg image quality are set for the preference.

Static Public Member Functions

static int GetPreferredImageQualityCount ()

Static Public Attributes

static const int kMediumScreenWidthThreshold = 720
static const int kLargeScreenWidthThreshold = 1500

Friends

class ImageRewriteTest
class RequestProperties

Detailed Description

This class keeps track of the device properties of the client, which are for the most part learned from the UserAgent string.


Member Enumeration Documentation

Enumerator:
kImageQualityDefault 

Server uses its own default image quality.

kImageQualityLow 

The request asks for low image quality.

kImageQualityMedium 

The request asks for medium image quality.

kImageQualityHigh 

The request asks for high image quality.


Member Function Documentation

void net_instaweb::DeviceProperties::SetPreferredImageQualities ( const std::vector< int > *  webp,
const std::vector< int > *  jpeg 
)

Does not own the vectors. Callers must ensure the lifetime of vectors exceeds that of the DeviceProperties.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines