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