summaryrefslogtreecommitdiffstats
path: root/chrome/browser/possible_url_model.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 20:25:01 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 20:25:01 +0000
commitc3a4bd9985658b8a5b229983a3ed85042005f0cf (patch)
tree6200f270a1063021b79c9d304dfe8a619fe86445 /chrome/browser/possible_url_model.cc
parent55a0ffd864ee04c0b76cbed90cb7f00aabed1192 (diff)
downloadchromium_src-c3a4bd9985658b8a5b229983a3ed85042005f0cf.zip
chromium_src-c3a4bd9985658b8a5b229983a3ed85042005f0cf.tar.gz
chromium_src-c3a4bd9985658b8a5b229983a3ed85042005f0cf.tar.bz2
FBTF: Remove a few SkBitmap instances (and other headers that were next to them).
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3161027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/possible_url_model.cc')
-rw-r--r--chrome/browser/possible_url_model.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/possible_url_model.cc b/chrome/browser/possible_url_model.cc
index 44fccf1..0577f4d 100644
--- a/chrome/browser/possible_url_model.cc
+++ b/chrome/browser/possible_url_model.cc
@@ -6,8 +6,10 @@
#include "app/resource_bundle.h"
#include "app/table_model_observer.h"
+#include "app/text_elider.h"
#include "base/callback.h"
#include "base/i18n/rtl.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/favicon_service.h"
@@ -17,6 +19,7 @@
#include "gfx/codec/png_codec.h"
#include "grit/app_resources.h"
#include "grit/generated_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
using base::Time;
using base::TimeDelta;
@@ -31,6 +34,20 @@ const int kPossibleURLTimeScope = 30;
} // anonymous namespace
+// Contains the data needed to show a result.
+struct PossibleURLModel::Result {
+ Result() : index(0) {}
+
+ GURL url;
+ // Index of this Result in results_. This is used as the key into
+ // fav_icon_map_ to lookup the favicon for the url, as well as the index
+ // into results_ when the favicon is received.
+ size_t index;
+ gfx::SortedDisplayURL display_url;
+ std::wstring title;
+};
+
+
PossibleURLModel::PossibleURLModel()
: profile_(NULL),
observer_(NULL) {
@@ -40,6 +57,9 @@ PossibleURLModel::PossibleURLModel()
}
}
+PossibleURLModel::~PossibleURLModel() {
+}
+
void PossibleURLModel::Reload(Profile *profile) {
profile_ = profile;
consumer_.CancelAllRequests();
@@ -85,6 +105,10 @@ void PossibleURLModel::OnHistoryQueryComplete(HistoryService::Handle h,
observer_->OnModelChanged();
}
+int PossibleURLModel::RowCount() {
+ return static_cast<int>(results_.size());
+}
+
const GURL& PossibleURLModel::GetURL(int row) {
if (row < 0 || row >= RowCount()) {
NOTREACHED();