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

Side by Side Diff: chrome/browser/extensions/extension_history_api.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
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/extensions/extension_history_api.h" 5 #include "chrome/browser/extensions/extension_history_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 bool SearchHistoryFunction::RunAsyncImpl() { 239 bool SearchHistoryFunction::RunAsyncImpl() {
240 EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY)); 240 EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_DICTIONARY));
241 DictionaryValue* json = static_cast<DictionaryValue*>(args_); 241 DictionaryValue* json = static_cast<DictionaryValue*>(args_);
242 242
243 // Initialize the HistoryQuery 243 // Initialize the HistoryQuery
244 std::wstring search_text; 244 std::wstring search_text;
245 EXTENSION_FUNCTION_VALIDATE(json->GetString(keys::kSearchKey, &search_text)); 245 EXTENSION_FUNCTION_VALIDATE(json->GetString(keys::kSearchKey, &search_text));
246 246
247 history::QueryOptions options; 247 history::QueryOptions options;
248 options.most_recent_visit_only = true;
249 options.SetRecentDayRange(1); 248 options.SetRecentDayRange(1);
250 options.max_count = 100; 249 options.max_count = 100;
251 250
252 if (json->HasKey(keys::kStartTimeKey)) { // Optional. 251 if (json->HasKey(keys::kStartTimeKey)) { // Optional.
253 Value* value; 252 Value* value;
254 EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kStartTimeKey, &value)); 253 EXTENSION_FUNCTION_VALIDATE(json->Get(keys::kStartTimeKey, &value));
255 EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &options.begin_time)); 254 EXTENSION_FUNCTION_VALIDATE(GetTimeFromValue(value, &options.begin_time));
256 } 255 }
257 if (json->HasKey(keys::kEndTimeKey)) { // Optional. 256 if (json->HasKey(keys::kEndTimeKey)) { // Optional.
258 Value* value; 257 Value* value;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 base::Time::Now(), // To the current time. 356 base::Time::Now(), // To the current time.
358 &cancelable_consumer_, 357 &cancelable_consumer_,
359 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete)); 358 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete));
360 359
361 return true; 360 return true;
362 } 361 }
363 362
364 void DeleteAllHistoryFunction::DeleteComplete() { 363 void DeleteAllHistoryFunction::DeleteComplete() {
365 SendAsyncResponse(); 364 SendAsyncResponse();
366 } 365 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/history_ui.cc ('k') | chrome/browser/history/expire_history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698