OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/base_history_model.h" | 5 #include "chrome/browser/base_history_model.h" |
6 | 6 |
7 #include "base/gfx/png_decoder.h" | 7 #include "base/gfx/png_decoder.h" |
8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/common/jpeg_codec.h" | 10 #include "chrome/common/jpeg_codec.h" |
11 #include "chrome/common/resource_bundle.h" | 11 #include "chrome/common/resource_bundle.h" |
12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
13 | 13 |
14 // Size of the favicon and thumbnail caches. | 14 // Size of the favicon and thumbnail caches. |
15 static const int kThumbnailCacheSize = 100; | 15 static const int kThumbnailCacheSize = 100; |
16 | 16 |
17 // Icon to display when one isn't found for the page. | 17 // Icon to display when one isn't found for the page. |
18 static SkBitmap* kDefaultFavicon = NULL; | 18 static SkBitmap* kDefaultFavicon = NULL; |
19 | 19 |
20 // static | 20 // static |
21 const int BaseHistoryModel::kHistoryScopeMonths = 18; | 21 const int BaseHistoryModel::kHistoryScopeMonths = 18; |
22 | 22 |
23 BaseHistoryModel::BaseHistoryModel(Profile* profile) | 23 BaseHistoryModel::BaseHistoryModel(Profile* profile) |
24 : profile_(profile), | 24 : profile_(profile), |
25 observer_(NULL), | 25 observer_(NULL), |
26 is_search_results_(false), | |
27 thumbnails_(kThumbnailCacheSize), | 26 thumbnails_(kThumbnailCacheSize), |
28 favicons_(kThumbnailCacheSize) { | 27 favicons_(kThumbnailCacheSize), |
| 28 is_search_results_(false) { |
29 if (!kDefaultFavicon) { | 29 if (!kDefaultFavicon) { |
30 kDefaultFavicon = ResourceBundle::GetSharedInstance(). | 30 kDefaultFavicon = ResourceBundle::GetSharedInstance(). |
31 GetBitmapNamed(IDR_DEFAULT_FAVICON); | 31 GetBitmapNamed(IDR_DEFAULT_FAVICON); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 BaseHistoryModel::~BaseHistoryModel() { | 35 BaseHistoryModel::~BaseHistoryModel() { |
36 } | 36 } |
37 | 37 |
38 void BaseHistoryModel::SetObserver(BaseHistoryModelObserver* observer) { | 38 void BaseHistoryModel::SetObserver(BaseHistoryModelObserver* observer) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 history::URLID page = | 150 history::URLID page = |
151 cancelable_consumer_.GetClientData( | 151 cancelable_consumer_.GetClientData( |
152 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS), handle); | 152 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS), handle); |
153 favicons_.Put(page, fav_icon); | 153 favicons_.Put(page, fav_icon); |
154 | 154 |
155 if (observer_) | 155 if (observer_) |
156 observer_->ModelChanged(false); | 156 observer_->ModelChanged(false); |
157 } | 157 } |
158 | 158 |
OLD | NEW |