summaryrefslogtreecommitdiffstats
path: root/chromium/content/public/browser/client_hints.h
blob: 295398742c57c50b41953604c3ca3ce1728bd626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_
#define CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_

#include "content/common/content_export.h"
#include "content/public/browser/client_hints_controller_delegate.h"
#include "net/http/http_request_headers.h"
#include "services/network/public/mojom/parsed_headers.mojom-forward.h"

namespace content {

class BrowserContext;

// Adds client hints headers for a prefetch navigation that is not associated
// with a frame. It must be a main frame navigation. |is_javascript_enabled| is
// whether JavaScript is enabled in blink or not.
CONTENT_EXPORT void AddClientHintsHeadersToPrefetchNavigation(
    const url::Origin& origin,
    net::HttpRequestHeaders* headers,
    BrowserContext* context,
    ClientHintsControllerDelegate* delegate,
    bool is_ua_override_on,
    bool is_javascript_enabled);

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class AcceptCHFrameRestart {
  kFramePresent = 0,
  kNavigationRestarted = 1,
  kRedirectOverflow = 2,
  kMaxValue = kRedirectOverflow,
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_CLIENT_HINTS_H_