Upstream version 11.40.277.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_public.browser.NavigationEntry;
8
9 /**
10  * This class represents a navigation item and is managed in XWalkNavigationHistoryInternal.
11  */
12 @XWalkAPI(createInternally = true)
13 public class XWalkNavigationItemInternal implements Cloneable {
14     private NavigationEntry mEntry;
15
16     // Never use this constructor.
17     // It is only used in XWalkNavigationItemBridge.
18     XWalkNavigationItemInternal() {
19         mEntry = null;
20     }
21
22     XWalkNavigationItemInternal(NavigationEntry entry) {
23         mEntry = entry;
24     }
25
26     XWalkNavigationItemInternal(XWalkNavigationItemInternal item) {
27         mEntry = item.mEntry;
28     }
29
30     /**
31      * Get the url of current navigation item.
32      * @return the string of the url.
33      * @since 1.0
34      */
35     @XWalkAPI
36     public String getUrl() {
37         return mEntry.getUrl();
38     }
39
40     /**
41      * Get the original url of current navigation item.
42      * @return the string of the original url.
43      * @since 1.0
44      */
45     @XWalkAPI
46     public String getOriginalUrl() {
47         return mEntry.getOriginalUrl();
48     }
49
50     /**
51      * Get the title of current navigation item.
52      * @return the string of the title.
53      * @since 1.0
54      */
55     @XWalkAPI
56     public String getTitle() {
57         return mEntry.getTitle();
58     }
59
60     protected synchronized XWalkNavigationItemInternal clone() {
61         return new XWalkNavigationItemInternal(this);
62     }
63 }