summaryrefslogtreecommitdiff
path: root/chromium/content/common/navigation_params_utils.h
blob: 7e35f07eef0ac2a81816ee691aa89b3f43e485c1 (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
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_COMMON_NAVIGATION_PARAMS_UTILS_H_
#define CONTENT_COMMON_NAVIGATION_PARAMS_UTILS_H_

#include "content/common/navigation_params.mojom.h"

namespace content {

class NavigationTypeUtils {
 public:
  static bool IsReload(mojom::NavigationType value) {
    return value == mojom::NavigationType::RELOAD ||
           value == mojom::NavigationType::RELOAD_BYPASSING_CACHE ||
           value == mojom::NavigationType::RELOAD_ORIGINAL_REQUEST_URL;
  }

  static bool IsSameDocument(mojom::NavigationType value) {
    return value == mojom::NavigationType::SAME_DOCUMENT ||
           value == mojom::NavigationType::HISTORY_SAME_DOCUMENT;
  }

  static bool IsHistory(mojom::NavigationType value) {
    return value == mojom::NavigationType::HISTORY_SAME_DOCUMENT ||
           value == mojom::NavigationType::HISTORY_DIFFERENT_DOCUMENT;
  }
};

}  // namespace content

#endif  // CONTENT_COMMON_NAVIGATION_PARAMS_UTILS_H_