Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / child / request_extra_data.h
blob614d9fc321cb528f0584ed885d0726cddd39f708
1 // Copyright (c) 2012 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 CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
6 #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
8 #include "base/compiler_specific.h"
9 #include "content/child/web_url_loader_impl.h"
10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
12 #include "third_party/WebKit/public/platform/WebString.h"
13 #include "third_party/WebKit/public/platform/WebURLRequest.h"
14 #include "ui/base/page_transition_types.h"
16 namespace content {
18 // Can be used by callers to store extra data on every ResourceRequest
19 // which will be incorporated into the ResourceHostMsg_Request message
20 // sent by ResourceDispatcher.
21 class CONTENT_EXPORT RequestExtraData
22 : public NON_EXPORTED_BASE(blink::WebURLRequest::ExtraData) {
23 public:
24 RequestExtraData();
25 virtual ~RequestExtraData();
27 blink::WebPageVisibilityState visibility_state() const {
28 return visibility_state_;
30 void set_visibility_state(blink::WebPageVisibilityState visibility_state) {
31 visibility_state_ = visibility_state;
33 int render_frame_id() const { return render_frame_id_; }
34 void set_render_frame_id(int render_frame_id) {
35 render_frame_id_ = render_frame_id;
37 bool is_main_frame() const { return is_main_frame_; }
38 void set_is_main_frame(bool is_main_frame) {
39 is_main_frame_ = is_main_frame;
41 GURL frame_origin() const { return frame_origin_; }
42 void set_frame_origin(const GURL& frame_origin) {
43 frame_origin_ = frame_origin;
45 bool parent_is_main_frame() const { return parent_is_main_frame_; }
46 void set_parent_is_main_frame(bool parent_is_main_frame) {
47 parent_is_main_frame_ = parent_is_main_frame;
49 int parent_render_frame_id() const { return parent_render_frame_id_; }
50 void set_parent_render_frame_id(int parent_render_frame_id) {
51 parent_render_frame_id_ = parent_render_frame_id;
53 bool allow_download() const { return allow_download_; }
54 void set_allow_download(bool allow_download) {
55 allow_download_ = allow_download;
57 ui::PageTransition transition_type() const { return transition_type_; }
58 void set_transition_type(ui::PageTransition transition_type) {
59 transition_type_ = transition_type;
61 bool should_replace_current_entry() const {
62 return should_replace_current_entry_;
64 void set_should_replace_current_entry(
65 bool should_replace_current_entry) {
66 should_replace_current_entry_ = should_replace_current_entry;
68 int transferred_request_child_id() const {
69 return transferred_request_child_id_;
71 void set_transferred_request_child_id(
72 int transferred_request_child_id) {
73 transferred_request_child_id_ = transferred_request_child_id;
75 int transferred_request_request_id() const {
76 return transferred_request_request_id_;
78 void set_transferred_request_request_id(
79 int transferred_request_request_id) {
80 transferred_request_request_id_ = transferred_request_request_id;
82 int service_worker_provider_id() const {
83 return service_worker_provider_id_;
85 void set_service_worker_provider_id(
86 int service_worker_provider_id) {
87 service_worker_provider_id_ = service_worker_provider_id;
89 // |custom_user_agent| is used to communicate an overriding custom user agent
90 // to |RenderViewImpl::willSendRequest()|; set to a null string to indicate no
91 // override and an empty string to indicate that there should be no user
92 // agent.
93 const blink::WebString& custom_user_agent() const {
94 return custom_user_agent_;
96 void set_custom_user_agent(const blink::WebString& custom_user_agent) {
97 custom_user_agent_ = custom_user_agent;
99 const blink::WebString& requested_with() const {
100 return requested_with_;
102 void set_requested_with(const blink::WebString& requested_with) {
103 requested_with_ = requested_with;
106 // PlzNavigate: |stream_override| is used to override certain parameters of
107 // navigation requests.
108 scoped_ptr<StreamOverrideParameters> TakeStreamOverrideOwnership() {
109 return stream_override_.Pass();
112 void set_stream_override(
113 scoped_ptr<StreamOverrideParameters> stream_override) {
114 stream_override_ = stream_override.Pass();
117 private:
118 blink::WebPageVisibilityState visibility_state_;
119 int render_frame_id_;
120 bool is_main_frame_;
121 GURL frame_origin_;
122 bool parent_is_main_frame_;
123 int parent_render_frame_id_;
124 bool allow_download_;
125 ui::PageTransition transition_type_;
126 bool should_replace_current_entry_;
127 int transferred_request_child_id_;
128 int transferred_request_request_id_;
129 int service_worker_provider_id_;
130 blink::WebString custom_user_agent_;
131 blink::WebString requested_with_;
132 scoped_ptr<StreamOverrideParameters> stream_override_;
134 DISALLOW_COPY_AND_ASSIGN(RequestExtraData);
137 } // namespace content
139 #endif // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_