OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
6 #define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 6 #define IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #import "ios/web/public/user_agent.h" | |
13 #import "ios/web/public/web_state/page_display_state.h" | 14 #import "ios/web/public/web_state/page_display_state.h" |
14 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
15 | 16 |
16 class GURL; | 17 class GURL; |
17 | 18 |
18 @class NSDictionary; | 19 @class NSDictionary; |
19 | 20 |
20 namespace web { | 21 namespace web { |
21 struct FaviconStatus; | 22 struct FaviconStatus; |
22 struct Referrer; | 23 struct Referrer; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 // | 102 // |
102 // If GetTimestamp() returns a null time, that means that either: | 103 // If GetTimestamp() returns a null time, that means that either: |
103 // | 104 // |
104 // - this navigation hasn't completed yet; | 105 // - this navigation hasn't completed yet; |
105 // - this navigation was restored and for some reason the | 106 // - this navigation was restored and for some reason the |
106 // timestamp wasn't available; | 107 // timestamp wasn't available; |
107 // - or this navigation was copied from a foreign session. | 108 // - or this navigation was copied from a foreign session. |
108 virtual void SetTimestamp(base::Time timestamp) = 0; | 109 virtual void SetTimestamp(base::Time timestamp) = 0; |
109 virtual base::Time GetTimestamp() const = 0; | 110 virtual base::Time GetTimestamp() const = 0; |
110 | 111 |
111 // |true| if this item uses a desktop user agent in HTTP requests and | 112 // The type of user agent requested for the navigation. Setting this to a new |
112 // UIWebView. | 113 // value will reset the virtual URL of this NavigationItem to the original |
113 virtual void SetIsOverridingUserAgent(bool is_overriding_user_agent) = 0; | 114 // request URL because the final value of the URL is dependent on a page's |
114 virtual bool IsOverridingUserAgent() const = 0; | 115 // implementation, which can potentially result in a different URL depending |
116 // on the user agent (e.g. www.page.com may be reloaded as m.page.com for | |
117 // UserAgentType::MOBILE). | |
118 virtual void SetUserAgentType(UserAgentType type) = 0; | |
Eugene But (OOO till 7-30)
2017/02/27 23:55:18
Sorry, only now I realized that content has SetIsO
kkhorimoto
2017/03/01 18:29:25
I've added a TODO to introduce the same change to
| |
119 virtual UserAgentType GetUserAgentType() const = 0; | |
115 | 120 |
116 // |true| if this item is the result of a POST request with data. | 121 // |true| if this item is the result of a POST request with data. |
117 virtual bool HasPostData() const = 0; | 122 virtual bool HasPostData() const = 0; |
118 | 123 |
119 // Returns the item's current http request headers. | 124 // Returns the item's current http request headers. |
120 virtual NSDictionary* GetHttpRequestHeaders() const = 0; | 125 virtual NSDictionary* GetHttpRequestHeaders() const = 0; |
121 | 126 |
122 // Adds headers from |additional_headers| to the item's http request headers. | 127 // Adds headers from |additional_headers| to the item's http request headers. |
123 // Existing headers with the same key will be overridden. | 128 // Existing headers with the same key will be overridden. |
124 virtual void AddHttpRequestHeaders(NSDictionary* additional_headers) = 0; | 129 virtual void AddHttpRequestHeaders(NSDictionary* additional_headers) = 0; |
125 }; | 130 }; |
126 | 131 |
127 } // namespace web | 132 } // namespace web |
128 | 133 |
129 #endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ | 134 #endif // IOS_WEB_PUBLIC_NAVIGATION_ITEM_H_ |
OLD | NEW |