Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java

Issue 10836155: Upstream ContentView.getNavigationHistory() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address tedchoc's review comments. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java b/content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java
new file mode 100644
index 0000000000000000000000000000000000000000..a2896efefb23f89adacd93f5eff87c3cb8c268d7
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java
@@ -0,0 +1,80 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import android.graphics.Bitmap;
+
+/**
+ * Represents one entry in the navigation history of a page.
+ */
+public class NavigationEntry {
+
+ private String mUrl;
+ private String mOriginalUrl;
+ private String mVirtualUrl;
+ private String mTitle;
+ private Bitmap mFavicon;
+
+ /**
+ * Default constructor.
+ */
+ /* package */ NavigationEntry(String url, String virtualUrl, String originalUrl, String title,
+ Bitmap favicon) {
+ mUrl = url;
+ mVirtualUrl = virtualUrl;
+ mOriginalUrl = originalUrl;
+ mTitle = title;
+ mFavicon = favicon;
+ }
+
+ /**
+ * @return The actual URL of the page. For some about pages, this may be a
+ * scary data: URL or something like that. Use GetVirtualURL() for
+ * showing to the user.
+ */
+ public String getUrl() {
+ return mUrl;
+ }
+
+ /**
+ * @return The virtual URL, when nonempty, will override the actual URL of
+ * the page when we display it to the user. This allows us to have
+ * nice and friendly URLs that the user sees for things like about:
+ * URLs, but actually feed the renderer a data URL that results in
+ * the content loading.
+ * <p/>
+ * GetVirtualURL() will return the URL to display to the user in all
+ * cases, so if there is no overridden display URL, it will return
+ * the actual one.
+ */
+ public String getVirtualUrl() {
+ return mVirtualUrl;
+ }
+
+ /**
+ * @return The URL that caused this NavigationEntry to be created.
+ */
+ public String getOriginalUrl() {
+ return mOriginalUrl;
+ }
+
+ /**
+ * @return The title as set by the page. This will be empty if there is no
+ * title set. The caller is responsible for detecting when there is
+ * no title and displaying the appropriate "Untitled" label if this
+ * is being displayed to the user.
+ */
+ public String getTitle() {
+ return mTitle;
+ }
+
+ /**
+ * @return The favicon of the page. This may be null.
+ */
+ public Bitmap getFavicon() {
+ return mFavicon;
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698