OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
8 | 8 |
9 /** | 9 /** |
10 * Represents one entry in the navigation history of a page. | 10 * Represents one entry in the navigation history of a page. |
11 */ | 11 */ |
12 public class NavigationEntry { | 12 public class NavigationEntry { |
13 | 13 |
14 private String mUrl; | 14 private final int mIndex; |
15 private String mOriginalUrl; | 15 private final String mUrl; |
16 private String mVirtualUrl; | 16 private final String mOriginalUrl; |
17 private String mTitle; | 17 private final String mVirtualUrl; |
| 18 private final String mTitle; |
18 private Bitmap mFavicon; | 19 private Bitmap mFavicon; |
19 | 20 |
20 /** | 21 /** |
21 * Default constructor. | 22 * Default constructor. |
22 */ | 23 */ |
23 /* package */ NavigationEntry(String url, String virtualUrl, String original
Url, String title, | 24 /* package */ NavigationEntry(int index, String url, String virtualUrl, Stri
ng originalUrl, |
24 Bitmap favicon) { | 25 String title, Bitmap favicon) { |
| 26 mIndex = index; |
25 mUrl = url; | 27 mUrl = url; |
26 mVirtualUrl = virtualUrl; | 28 mVirtualUrl = virtualUrl; |
27 mOriginalUrl = originalUrl; | 29 mOriginalUrl = originalUrl; |
28 mTitle = title; | 30 mTitle = title; |
29 mFavicon = favicon; | 31 mFavicon = favicon; |
30 } | 32 } |
31 | 33 |
32 /** | 34 /** |
| 35 * @return The index into the navigation history that this entry represents. |
| 36 */ |
| 37 public int getIndex() { |
| 38 return mIndex; |
| 39 } |
| 40 |
| 41 /** |
33 * @return The actual URL of the page. For some about pages, this may be a | 42 * @return The actual URL of the page. For some about pages, this may be a |
34 * scary data: URL or something like that. Use GetVirtualURL() for | 43 * scary data: URL or something like that. Use GetVirtualURL() for |
35 * showing to the user. | 44 * showing to the user. |
36 */ | 45 */ |
37 public String getUrl() { | 46 public String getUrl() { |
38 return mUrl; | 47 return mUrl; |
39 } | 48 } |
40 | 49 |
41 /** | 50 /** |
42 * @return The virtual URL, when nonempty, will override the actual URL of | 51 * @return The virtual URL, when nonempty, will override the actual URL of |
(...skipping 27 matching lines...) Expand all Loading... |
70 return mTitle; | 79 return mTitle; |
71 } | 80 } |
72 | 81 |
73 /** | 82 /** |
74 * @return The favicon of the page. This may be null. | 83 * @return The favicon of the page. This may be null. |
75 */ | 84 */ |
76 public Bitmap getFavicon() { | 85 public Bitmap getFavicon() { |
77 return mFavicon; | 86 return mFavicon; |
78 } | 87 } |
79 | 88 |
| 89 /** |
| 90 * @param favicon The updated favicon to replace the existing one with. |
| 91 */ |
| 92 public void updateFavicon(Bitmap favicon) { |
| 93 mFavicon = favicon; |
| 94 } |
80 } | 95 } |
OLD | NEW |