Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / net / client_hints.h
blobc4beb39011fca11a5e22197754dc7d8741660ccd
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_
8 #include <string>
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
16 class ClientHints {
17 public:
18 static const char kDevicePixelRatioHeader[];
20 ClientHints();
21 ~ClientHints();
23 void Init();
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;
29 private:
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_