Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 1 | // Copyright 2017 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 CHROME_BROWSER_CLIENT_HINTS_CLIENT_HINTS_H_ |
| 6 | #define CHROME_BROWSER_CLIENT_HINTS_CLIENT_HINTS_H_ |
| 7 | |
| 8 | #include <memory> |
Yoav Weiss | 603be26 | 2019-03-04 13:14:57 | [diff] [blame] | 9 | #include <string> |
Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 10 | |
Tarun Bansal | a61f0f6 | 2017-10-24 23:53:05 | [diff] [blame] | 11 | #include "base/memory/ref_counted.h" |
Tarun Bansal | 509a8dd | 2018-04-10 17:19:16 | [diff] [blame] | 12 | #include "base/optional.h" |
Tarun Bansal | 837bac2 | 2018-12-12 06:59:01 | [diff] [blame] | 13 | #include "components/keyed_service/core/keyed_service.h" |
Tarun Bansal | 1ff665c | 2019-01-09 16:35:52 | [diff] [blame] | 14 | #include "content/public/browser/client_hints_controller_delegate.h" |
Tarun Bansal | a61f0f6 | 2017-10-24 23:53:05 | [diff] [blame] | 15 | |
Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 16 | class GURL; |
| 17 | |
Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 18 | namespace client_hints { |
| 19 | |
Tarun Bansal | 1ff665c | 2019-01-09 16:35:52 | [diff] [blame] | 20 | class ClientHints : public KeyedService, |
| 21 | public content::ClientHintsControllerDelegate { |
Tarun Bansal | 837bac2 | 2018-12-12 06:59:01 | [diff] [blame] | 22 | public: |
| 23 | explicit ClientHints(content::BrowserContext* context); |
| 24 | ~ClientHints() override; |
| 25 | |
Tarun Bansal | 1ff665c | 2019-01-09 16:35:52 | [diff] [blame] | 26 | // content::ClientHintsControllerDelegate: |
Yoav Weiss | 603be26 | 2019-03-04 13:14:57 | [diff] [blame] | 27 | network::NetworkQualityTracker* GetNetworkQualityTracker() override; |
| 28 | |
| 29 | void GetAllowedClientHintsFromSource( |
Arthur Sonzogni | 62a4f435 | 2019-01-07 16:37:25 | [diff] [blame] | 30 | const GURL& url, |
Yoav Weiss | 603be26 | 2019-03-04 13:14:57 | [diff] [blame] | 31 | blink::WebEnabledClientHints* client_hints) override; |
| 32 | |
| 33 | bool IsJavaScriptAllowed(const GURL& url) override; |
| 34 | |
| 35 | std::string GetAcceptLanguageString() override; |
| 36 | |
| 37 | blink::UserAgentMetadata GetUserAgentMetadata() override; |
Tarun Bansal | 837bac2 | 2018-12-12 06:59:01 | [diff] [blame] | 38 | |
| 39 | private: |
| 40 | content::BrowserContext* context_; |
| 41 | |
| 42 | DISALLOW_COPY_AND_ASSIGN(ClientHints); |
| 43 | }; |
Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 44 | |
Tarun Bansal | 6bf5430 | 2017-10-02 07:39:14 | [diff] [blame] | 45 | } // namespace client_hints |
| 46 | |
| 47 | #endif // CHROME_BROWSER_CLIENT_HINTS_CLIENT_HINTS_H_ |