Upstream version 5.34.97.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / android / core / src / org / xwalk / core / WebHistoryItem.java
1 // Copyright (c) 2013 Intel Corporation. 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.
4
5 package org.xwalk.core;
6
7 import android.graphics.Bitmap;
8
9 import org.chromium.content.browser.NavigationEntry;
10
11 // Wrap NavigationEntry in content as WebHistoryItem.
12 public class WebHistoryItem implements Cloneable {
13     private static int mNextId = 0;
14     private int mId;
15     private NavigationEntry mEntry;
16     public WebHistoryItem(NavigationEntry entry) {
17         mId = mNextId++;
18         mEntry = entry;
19     }
20
21     public WebHistoryItem(WebHistoryItem item) {
22         mId = item.mId;
23         mEntry = item.mEntry;
24     }
25
26     @Deprecated
27     public int getId() {
28         return mId;
29     }
30
31     public String getUrl() {
32         return mEntry.getUrl();
33     }
34
35     public String getOriginalUrl() {
36         return mEntry.getOriginalUrl();
37     }
38
39     public String getTitle() {
40         return mEntry.getTitle();
41     }
42
43     public Bitmap getFavicon() {
44         return mEntry.getFavicon();
45     }
46
47     protected synchronized WebHistoryItem clone() {
48         return new WebHistoryItem(this);
49     }
50 }