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

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

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)
Patch Set: Update NavigationItemImpl to use NavigationInitiationType 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
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..b69c07e0e0aa196649e6a61fb11ec502d724a42e 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,11 @@ class NavigationItemImpl : public web::NavigationItem {
void SetIsCreatedFromHashChange(bool hash_change);
bool IsCreatedFromHashChange() const;
+ // Whether this (pending) navigation is renderer-initiated. Resets to false
+ // after commit.
+ void SetIsRendererInitiated(bool is_renderer_initiated);
kkhorimoto 2017/02/17 20:51:35 Instead of passing a bool here, let's just have a
liaoyuke 2017/02/17 22:15:40 Done.
+ bool IsRendererInitiated() 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 +119,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 +145,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_;

Powered by Google App Engine
This is Rietveld 408576698