Upstream version 8.36.161.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / android / core_internal / src / org / xwalk / core / internal / XWalkNavigationItemInternal.java
1 // Copyright (c) 2013-2014 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.internal;
6
7 import org.chromium.content.browser.NavigationEntry;
8
9 /**
10  * This class represents a navigation item and is managed in XWalkNavigationHistoryInternal.
11  */
12 public class XWalkNavigationItemInternal implements Cloneable {
13     private NavigationEntry mEntry;
14
15     XWalkNavigationItemInternal(NavigationEntry entry) {
16         mEntry = entry;
17     }
18
19     public XWalkNavigationItemInternal(XWalkNavigationItemInternal item) {
20         mEntry = item.mEntry;
21     }
22
23     /**
24      * Get the url of current navigation item.
25      * @return the string of the url.
26      * @since 1.0
27      */
28     public String getUrl() {
29         return mEntry.getUrl();
30     }
31
32     /**
33      * Get the original url of current navigation item.
34      * @return the string of the original url.
35      * @since 1.0
36      */
37     public String getOriginalUrl() {
38         return mEntry.getOriginalUrl();
39     }
40
41     /**
42      * Get the title of current navigation item.
43      * @return the string of the title.
44      * @since 1.0
45      */
46     public String getTitle() {
47         return mEntry.getTitle();
48     }
49
50     protected synchronized XWalkNavigationItemInternal clone() {
51         return new XWalkNavigationItemInternal(this);
52     }
53 }