1 // Copyright 2012 The Chromium Authors. 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.
5 package org.chromium.content.browser;
7 import android.graphics.Bitmap;
10 * Represents one entry in the navigation history of a page.
12 public class NavigationEntry {
14 private final int mIndex;
15 private final String mUrl;
16 private final String mOriginalUrl;
17 private final String mVirtualUrl;
18 private final String mTitle;
19 private Bitmap mFavicon;
22 * Default constructor.
24 protected NavigationEntry(int index, String url, String virtualUrl, String originalUrl,
25 String title, Bitmap favicon) {
28 mVirtualUrl = virtualUrl;
29 mOriginalUrl = originalUrl;
35 * @return The index into the navigation history that this entry represents.
37 public int getIndex() {
42 * @return The actual URL of the page. For some about pages, this may be a
43 * scary data: URL or something like that. Use GetVirtualURL() for
44 * showing to the user.
46 public String getUrl() {
51 * @return The virtual URL, when nonempty, will override the actual URL of
52 * the page when we display it to the user. This allows us to have
53 * nice and friendly URLs that the user sees for things like about:
54 * URLs, but actually feed the renderer a data URL that results in
55 * the content loading.
57 * GetVirtualURL() will return the URL to display to the user in all
58 * cases, so if there is no overridden display URL, it will return
61 public String getVirtualUrl() {
66 * @return The URL that caused this NavigationEntry to be created.
68 public String getOriginalUrl() {
73 * @return The title as set by the page. This will be empty if there is no
74 * title set. The caller is responsible for detecting when there is
75 * no title and displaying the appropriate "Untitled" label if this
76 * is being displayed to the user.
78 public String getTitle() {
83 * @return The favicon of the page. This may be null.
85 public Bitmap getFavicon() {
90 * @param favicon The updated favicon to replace the existing one with.
92 public void updateFavicon(Bitmap favicon) {