summaryrefslogtreecommitdiffstats
path: root/components/navigation_interception/navigation_params.cc
blob: 54288f76c724c537460a84a629462c5587a06d47 (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
40
41
42
43
44
45
46
47
// Copyright (c) 2013 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.

#include "components/navigation_interception/navigation_params.h"

namespace navigation_interception {

NavigationParams::NavigationParams(const NavigationParams& other) {
  Assign(other);
}

NavigationParams::NavigationParams(const GURL& url,
                                   const content::Referrer& referrer,
                                   bool has_user_gesture,
                                   bool is_post,
                                   ui::PageTransition transition_type,
                                   bool is_redirect,
                                   bool is_external_protocol,
                                   bool is_main_frame)
    : url_(url),
      referrer_(referrer),
      has_user_gesture_(has_user_gesture),
      is_post_(is_post),
      transition_type_(transition_type),
      is_redirect_(is_redirect),
      is_external_protocol_(is_external_protocol),
      is_main_frame_(is_main_frame) {
}

void NavigationParams::operator=(const NavigationParams& rhs) {
  Assign(rhs);
}

void NavigationParams::Assign(const NavigationParams& other) {
  url_ = other.url();
  referrer_ = other.referrer();
  has_user_gesture_ = other.has_user_gesture();
  is_post_ = other.is_post();
  transition_type_ = other.transition_type();
  is_redirect_ = other.is_redirect();
  is_external_protocol_ = other.is_external_protocol();
  is_main_frame_ = other.is_main_frame();
}

}  // namespace navigation_interception