Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: ios/web/navigation/navigation_item_impl.h

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)
Patch Set: Fix unit tests and rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/navigation/crw_session_controller_unittest.mm ('k') | ios/web/navigation/navigation_item_impl.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_item_impl.h
diff --git a/ios/web/navigation/navigation_item_impl.h b/ios/web/navigation/navigation_item_impl.h
index 1b57b3df1cb0698da3c20894e1b3caab2d2309db..f42cacc8c0c060a66d5dffc7ea6aeb183dfb29ce 100644
--- a/ios/web/navigation/navigation_item_impl.h
+++ b/ios/web/navigation/navigation_item_impl.h
@@ -22,6 +22,7 @@ namespace web {
class NavigationItemFacadeDelegate;
class NavigationItemStorageBuilder;
+enum class NavigationInitiationType;
// Implementation of NavigationItem.
class NavigationItemImpl : public web::NavigationItem {
@@ -94,6 +95,12 @@ class NavigationItemImpl : public web::NavigationItem {
void SetIsCreatedFromHashChange(bool hash_change);
bool IsCreatedFromHashChange() const;
+ // The initiation type of this pending navigation. Resets to user-initiated
+ // after commit.
+ void SetNavigationInitiationType(
+ web::NavigationInitiationType navigation_initiation_type);
+ web::NavigationInitiationType NavigationInitiationType() const;
+
// Whether or not to bypass showing the repost form confirmation when loading
// a POST request. Set to YES for browser-generated POST requests.
void SetShouldSkipRepostFormConfirmation(bool skip);
@@ -113,13 +120,6 @@ class NavigationItemImpl : public web::NavigationItem {
// non-persisted state, as documented on the members below.
void ResetForCommit();
- // Whether this (pending) navigation is renderer-initiated. Resets to false
- // for all types of navigations after commit.
- void set_is_renderer_initiated(bool is_renderer_initiated) {
- is_renderer_initiated_ = is_renderer_initiated;
- }
- bool is_renderer_initiated() const { return is_renderer_initiated_; }
-
private:
// The NavigationManItemStorageBuilder functions require access to
// private variables of NavigationItemImpl.
@@ -146,10 +146,10 @@ class NavigationItemImpl : public web::NavigationItem {
bool should_skip_repost_form_confirmation_;
base::scoped_nsobject<NSData> post_data_;
- // Whether the item, while loading, was created for a renderer-initiated
- // navigation. This dictates whether the URL should be displayed before the
- // navigation commits. It is cleared in |ResetForCommit| and not persisted.
- bool is_renderer_initiated_;
+ // The navigation initiation type of the item. This decides whether the URL
+ // should be displayed before the navigation commits. It is cleared in
+ // |ResetForCommit| and not persisted.
+ web::NavigationInitiationType navigation_initiation_type_;
// Whether the navigation contains unsafe resources.
bool is_unsafe_;
« no previous file with comments | « ios/web/navigation/crw_session_controller_unittest.mm ('k') | ios/web/navigation/navigation_item_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698