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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_ITEM_IMPL_H_
6 #define IOS_WEB_NAVIGATION_NAVIGATION_ITEM_IMPL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h"
11 #include "ios/web/public/favicon_status.h"
12 #include "ios/web/public/navigation_item.h"
13 #include "ios/web/public/referrer.h"
14 #include "ios/web/public/ssl_status.h"
19 // Implementation of NavigationItem.
20 class NavigationItemImpl
: public web::NavigationItem
{
22 // Creates a default NavigationItemImpl.
24 virtual ~NavigationItemImpl();
26 // NavigationItem implementation:
27 virtual int GetUniqueID() const override
;
28 virtual void SetURL(const GURL
& url
) override
;
29 virtual const GURL
& GetURL() const override
;
30 virtual void SetReferrer(const web::Referrer
& referrer
) override
;
31 virtual const web::Referrer
& GetReferrer() const override
;
32 virtual void SetVirtualURL(const GURL
& url
) override
;
33 virtual const GURL
& GetVirtualURL() const override
;
34 virtual void SetTitle(const base::string16
& title
) override
;
35 virtual const base::string16
& GetTitle() const override
;
36 virtual void SetPageID(int page_id
) override
;
37 virtual int32
GetPageID() const override
;
38 virtual const base::string16
& GetTitleForDisplay(
39 const std::string
& languages
) const override
;
40 virtual void SetTransitionType(ui::PageTransition transition_type
) override
;
41 virtual ui::PageTransition
GetTransitionType() const override
;
42 virtual const FaviconStatus
& GetFavicon() const override
;
43 virtual FaviconStatus
& GetFavicon() override
;
44 virtual const SSLStatus
& GetSSL() const override
;
45 virtual SSLStatus
& GetSSL() override
;
46 virtual void SetTimestamp(base::Time timestamp
) override
;
47 virtual base::Time
GetTimestamp() const override
;
54 base::string16 title_
;
56 ui::PageTransition transition_type_
;
57 FaviconStatus favicon_
;
59 base::Time timestamp_
;
61 // This is a cached version of the result of GetTitleForDisplay. When the URL,
62 // virtual URL, or title is set, this should be cleared to force a refresh.
63 mutable base::string16 cached_display_title_
;
65 // Copy and assignment is explicitly allowed for this class.
70 #endif // IOS_WEB_NAVIGATION_NAVIGATION_ITEM_IMPL_H_