| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ |
| 6 #define IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ | 6 #define IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #ifndef NDEBUG | 28 #ifndef NDEBUG |
| 29 // Returns human readable description of this object. | 29 // Returns human readable description of this object. |
| 30 NSString* GetDescription() const; | 30 NSString* GetDescription() const; |
| 31 #endif // NDEBUG | 31 #endif // NDEBUG |
| 32 | 32 |
| 33 // NavigationContext overrides: | 33 // NavigationContext overrides: |
| 34 WebState* GetWebState() override; | 34 WebState* GetWebState() override; |
| 35 const GURL& GetUrl() const override; | 35 const GURL& GetUrl() const override; |
| 36 ui::PageTransition GetPageTransition() const override; | 36 ui::PageTransition GetPageTransition() const override; |
| 37 bool IsSameDocument() const override; | 37 bool IsSameDocument() const override; |
| 38 bool IsPost() const override; |
| 38 NSError* GetError() const override; | 39 NSError* GetError() const override; |
| 39 net::HttpResponseHeaders* GetResponseHeaders() const override; | 40 net::HttpResponseHeaders* GetResponseHeaders() const override; |
| 40 ~NavigationContextImpl() override; | 41 ~NavigationContextImpl() override; |
| 41 | 42 |
| 42 // Setters for navigation context data members. | 43 // Setters for navigation context data members. |
| 43 void SetIsSameDocument(bool is_same_document); | 44 void SetIsSameDocument(bool is_same_document); |
| 45 void SetIsPost(bool is_post); |
| 44 void SetError(NSError* error); | 46 void SetError(NSError* error); |
| 45 void SetResponseHeaders( | 47 void SetResponseHeaders( |
| 46 const scoped_refptr<net::HttpResponseHeaders>& response_headers); | 48 const scoped_refptr<net::HttpResponseHeaders>& response_headers); |
| 47 | 49 |
| 48 // Optional unique id of the navigation item associated with this navigaiton. | 50 // Optional unique id of the navigation item associated with this navigaiton. |
| 49 int GetNavigationItemUniqueID() const; | 51 int GetNavigationItemUniqueID() const; |
| 50 void SetNavigationItemUniqueID(int unique_id); | 52 void SetNavigationItemUniqueID(int unique_id); |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 NavigationContextImpl(WebState* web_state, | 55 NavigationContextImpl(WebState* web_state, |
| 54 const GURL& url, | 56 const GURL& url, |
| 55 ui::PageTransition page_transition); | 57 ui::PageTransition page_transition); |
| 56 | 58 |
| 57 WebState* web_state_ = nullptr; | 59 WebState* web_state_ = nullptr; |
| 58 GURL url_; | 60 GURL url_; |
| 59 ui::PageTransition page_transition_; | 61 ui::PageTransition page_transition_; |
| 60 bool is_same_document_ = false; | 62 bool is_same_document_ = false; |
| 63 bool is_post_ = false; |
| 61 base::scoped_nsobject<NSError> error_; | 64 base::scoped_nsobject<NSError> error_; |
| 62 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 65 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
| 63 int navigation_item_unique_id_ = -1; | 66 int navigation_item_unique_id_ = -1; |
| 64 | 67 |
| 65 DISALLOW_COPY_AND_ASSIGN(NavigationContextImpl); | 68 DISALLOW_COPY_AND_ASSIGN(NavigationContextImpl); |
| 66 }; | 69 }; |
| 67 | 70 |
| 68 } // namespace web | 71 } // namespace web |
| 69 | 72 |
| 70 #endif // IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ | 73 #endif // IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_ |
| OLD | NEW |