Roll src/third_party/WebKit f007c95:0171005 (svn 185074:185088)
[chromium-blink-merge.git] / ios / web / navigation / navigation_item_impl.h
blob1e4707f01efb8121c804a4dd6a76a578229dd867
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"
15 #include "url/gurl.h"
17 namespace web {
19 // Implementation of NavigationItem.
20 class NavigationItemImpl : public web::NavigationItem {
21 public:
22 // Creates a default NavigationItemImpl.
23 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;
49 private:
50 int unique_id_;
51 GURL url_;
52 Referrer referrer_;
53 GURL virtual_url_;
54 base::string16 title_;
55 int32 page_id_;
56 ui::PageTransition transition_type_;
57 FaviconStatus favicon_;
58 SSLStatus ssl_;
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.
68 } // namespace web
70 #endif // IOS_WEB_NAVIGATION_NAVIGATION_ITEM_IMPL_H_