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

Side by Side Diff: components/omnibox/answers_cache.cc

Issue 489353004: Componentize SearchProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « components/omnibox/answers_cache.h ('k') | components/omnibox/answers_cache_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/autocomplete/answers_cache.h" 5 #include "components/omnibox/answers_cache.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 8
9 AnswersQueryData::AnswersQueryData() { 9 AnswersQueryData::AnswersQueryData() {
10 } 10 }
11 AnswersQueryData::AnswersQueryData(const base::string16& text, 11 AnswersQueryData::AnswersQueryData(const base::string16& text,
12 const base::string16& type) 12 const base::string16& type)
13 : full_query_text(text), query_type(type) { 13 : full_query_text(text), query_type(type) {
14 } 14 }
15 15
(...skipping 26 matching lines...) Expand all
42 return; 42 return;
43 } 43 }
44 } 44 }
45 45
46 // Evict if cache size is exceeded. 46 // Evict if cache size is exceeded.
47 if (cache_.size() >= max_entries_) 47 if (cache_.size() >= max_entries_)
48 cache_.pop_back(); 48 cache_.pop_back();
49 49
50 cache_.push_front(AnswersQueryData(full_query_text, query_type)); 50 cache_.push_front(AnswersQueryData(full_query_text, query_type));
51 } 51 }
OLDNEW
« no previous file with comments | « components/omnibox/answers_cache.h ('k') | components/omnibox/answers_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698