| 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 26cc2bc36d42b36ee14cd15ff56848f84847f076..b02ade35fb9e323c78c770fc20f95a2ceffea01e 100644
|
| --- a/ios/web/navigation/navigation_item_impl.h
|
| +++ b/ios/web/navigation/navigation_item_impl.h
|
| @@ -8,14 +8,18 @@
|
| #include "base/basictypes.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/strings/string16.h"
|
| +#include "ios/web/navigation/navigation_item_facade_delegate.h"
|
| #include "ios/web/public/favicon_status.h"
|
| #include "ios/web/public/navigation_item.h"
|
| #include "ios/web/public/referrer.h"
|
| #include "ios/web/public/ssl_status.h"
|
| #include "url/gurl.h"
|
|
|
| +
|
| namespace web {
|
|
|
| +class NavigationItemFacadeDelegate;
|
| +
|
| // Implementation of NavigationItem.
|
| class NavigationItemImpl : public web::NavigationItem {
|
| public:
|
| @@ -23,6 +27,17 @@ class NavigationItemImpl : public web::NavigationItem {
|
| NavigationItemImpl();
|
| ~NavigationItemImpl() override;
|
|
|
| + // Since NavigationItemImpls own their facade delegates, there is no implicit
|
| + // copy constructor (scoped_ptrs can't be copied), so one is defined here.
|
| + NavigationItemImpl(const NavigationItemImpl& item);
|
| +
|
| + // Accessors for the delegate used to drive the navigation entry facade.
|
| + // NOTE: to minimize facade synchronization code, NavigationItems take
|
| + // ownership of their facade delegates.
|
| + void SetFacadeDelegate(
|
| + scoped_ptr<NavigationItemFacadeDelegate> facade_delegate);
|
| + NavigationItemFacadeDelegate* GetFacadeDelegate() const;
|
| +
|
| // NavigationItem implementation:
|
| int GetUniqueID() const override;
|
| void SetURL(const GURL& url) override;
|
| @@ -45,6 +60,19 @@ class NavigationItemImpl : public web::NavigationItem {
|
| SSLStatus& GetSSL() override;
|
| void SetTimestamp(base::Time timestamp) override;
|
| base::Time GetTimestamp() const override;
|
| + void SetUnsafe(bool is_unsafe) override;
|
| + bool IsUnsafe() const override;
|
| +
|
| + // Once a navigation item is committed, we should no longer track
|
| + // 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:
|
| int unique_id_;
|
| @@ -58,10 +86,21 @@ class NavigationItemImpl : public web::NavigationItem {
|
| SSLStatus ssl_;
|
| base::Time timestamp_;
|
|
|
| + // 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_;
|
| +
|
| + // Whether the navigation contains unsafe resources.
|
| + bool is_unsafe_;
|
| +
|
| // This is a cached version of the result of GetTitleForDisplay. When the URL,
|
| // virtual URL, or title is set, this should be cleared to force a refresh.
|
| mutable base::string16 cached_display_title_;
|
|
|
| + // Weak pointer to the facade delegate.
|
| + scoped_ptr<NavigationItemFacadeDelegate> facade_delegate_;
|
| +
|
| // Copy and assignment is explicitly allowed for this class.
|
| };
|
|
|
|
|