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

Side by Side Diff: chrome/browser/possible_url_model.cc

Issue 341087: Eliminate QueryOptions::most_recent_visit_only. All non-unittest consumers o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/visit_database_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/possible_url_model.h" 5 #include "chrome/browser/possible_url_model.h"
6 6
7 #include "app/gfx/codec/png_codec.h" 7 #include "app/gfx/codec/png_codec.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "app/table_model_observer.h" 10 #include "app/table_model_observer.h"
(...skipping 29 matching lines...) Expand all
40 void PossibleURLModel::Reload(Profile *profile) { 40 void PossibleURLModel::Reload(Profile *profile) {
41 profile_ = profile; 41 profile_ = profile;
42 consumer_.CancelAllRequests(); 42 consumer_.CancelAllRequests();
43 HistoryService* hs = 43 HistoryService* hs =
44 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); 44 profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
45 if (hs) { 45 if (hs) {
46 history::QueryOptions options; 46 history::QueryOptions options;
47 options.end_time = Time::Now(); 47 options.end_time = Time::Now();
48 options.begin_time = 48 options.begin_time =
49 options.end_time - TimeDelta::FromDays(kPossibleURLTimeScope); 49 options.end_time - TimeDelta::FromDays(kPossibleURLTimeScope);
50 options.most_recent_visit_only = true;
51 options.max_count = 50; 50 options.max_count = 50;
52 51
53 hs->QueryHistory(std::wstring(), options, &consumer_, 52 hs->QueryHistory(std::wstring(), options, &consumer_,
54 NewCallback(this, &PossibleURLModel::OnHistoryQueryComplete)); 53 NewCallback(this, &PossibleURLModel::OnHistoryQueryComplete));
55 } 54 }
56 } 55 }
57 56
58 void PossibleURLModel::OnHistoryQueryComplete(HistoryService::Handle h, 57 void PossibleURLModel::OnHistoryQueryComplete(HistoryService::Handle h,
59 history::QueryResults* result) { 58 history::QueryResults* result) {
60 results_.resize(result->size()); 59 results_.resize(result->size());
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // The decoder will leave our bitmap empty on error. 177 // The decoder will leave our bitmap empty on error.
179 gfx::PNGCodec::Decode(data->front(), data->size(), 178 gfx::PNGCodec::Decode(data->front(), data->size(),
180 &(fav_icon_map_[index])); 179 &(fav_icon_map_[index]));
181 180
182 // Notify the observer. 181 // Notify the observer.
183 if (!fav_icon_map_[index].isNull() && observer_) 182 if (!fav_icon_map_[index].isNull() && observer_)
184 observer_->OnItemsChanged(static_cast<int>(index), 1); 183 observer_->OnItemsChanged(static_cast<int>(index), 1);
185 } 184 }
186 } 185 }
187 } 186 }
OLDNEW
« no previous file with comments | « chrome/browser/history/visit_database_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698