summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webhistoryitem_impl.h
blob: b28fb912c20cd82b2466753436d5b912221b9c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_GLUE_WEBHISTORYITEM_IMPL_H_
#define WEBKIT_GLUE_WEBHISTORYITEM_IMPL_H_

#include "webkit/glue/webhistoryitem.h"
#include "googleurl/src/gurl.h"

#include "RefPtr.h"

namespace WebCore {
  class HistoryItem;
}

class WebHistoryItemImpl : public WebHistoryItem {
 public:
  WebHistoryItemImpl(const GURL& url,
                     const std::wstring& title,
                     const std::string& history_state,
                     WebRequest::ExtraData* extra_data);
  virtual ~WebHistoryItemImpl();

  // WebHistoryItem
  virtual const GURL& GetURL() const;
  virtual const std::wstring& GetTitle() const;
  virtual const std::string& GetHistoryState() const;
  virtual WebRequest::ExtraData* GetExtraData() const;

  // WebHistoryItemImpl
  // Returns a WebCore::HistoryItem based on the history_state.  This is
  // lazily-created and cached.
  WebCore::HistoryItem* GetHistoryItem() const;

 protected:
  GURL url_;
  std::wstring title_;
  std::string history_state_;
  mutable RefPtr<WebCore::HistoryItem> history_item_;
  scoped_refptr<WebRequest::ExtraData> extra_data_;

 private:
  DISALLOW_COPY_AND_ASSIGN(WebHistoryItemImpl);
};

#endif  // #ifndef WEBKIT_GLUE_WEBHISTORYITEM_IMPL_H_