1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_NET_CLIENT_HINTS_H_
6 #define CHROME_BROWSER_NET_CLIENT_HINTS_H_
10 #include "base/basictypes.h"
11 #include "base/memory/weak_ptr.h"
13 // ClientHints is a repository in Chrome for information used
14 // to create the Client-Hints request header. For more information, see:
15 // https://github.com/igrigorik/http-client-hints/blob/draft2/draft-grigorik-http-client-hints-01.txt
18 static const char kDevicePixelRatioHeader
[];
25 // Returns the device pixel ratio as a string. Its value is the same as
26 // window.devicePixelRatio in Javascript.
27 const std::string
& GetDevicePixelRatioHeader() const;
30 friend class ClientHintsTest
;
32 // Retrieves and updates screen information for use on the IO thread.
33 bool RetrieveScreenInfo();
35 void UpdateScreenInfo(float device_pixel_ratio_value
);
37 std::string screen_hints_
;
39 base::WeakPtrFactory
<ClientHints
> weak_ptr_factory_
;
41 DISALLOW_COPY_AND_ASSIGN(ClientHints
);
44 #endif // CHROME_BROWSER_NET_CLIENT_HINTS_H_