OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/search/history.h" | 5 #include "ui/app_list/search/history.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 TokenizedString tokenized(base::UTF8ToUTF16(utf8)); | 21 TokenizedString tokenized(base::UTF8ToUTF16(utf8)); |
22 return base::UTF16ToUTF8( | 22 return base::UTF16ToUTF8( |
23 base::JoinString(tokenized.tokens(), base::ASCIIToUTF16(" "))); | 23 base::JoinString(tokenized.tokens(), base::ASCIIToUTF16(" "))); |
24 } | 24 } |
25 | 25 |
26 } // namespace | 26 } // namespace |
27 | 27 |
28 History::History(scoped_refptr<HistoryDataStore> store) | 28 History::History(scoped_refptr<HistoryDataStore> store) |
29 : store_(store), data_loaded_(false) { | 29 : store_(store), data_loaded_(false) { |
30 const size_t kMaxQueryEntries = 1000; | 30 const size_t kMaxQueryEntries = 1000; |
31 const size_t kMaxSecondaryQueries = 5; | 31 const size_t kMaxSecondaryQueries = 8; |
mtomasz
2016/07/19 07:07:56
(Not sure if this change is necessary.)
Matt Giuca
2016/07/19 07:29:10
I don't know what this is and I don't think it's r
xiyuan
2016/07/19 15:22:55
Matt is right that this is not relevant to what th
mtomasz
2016/07/20 00:46:48
Removed. Done.
| |
32 | 32 |
33 data_.reset( | 33 data_.reset( |
34 new HistoryData(store_.get(), kMaxQueryEntries, kMaxSecondaryQueries)); | 34 new HistoryData(store_.get(), kMaxQueryEntries, kMaxSecondaryQueries)); |
35 data_->AddObserver(this); | 35 data_->AddObserver(this); |
36 } | 36 } |
37 | 37 |
38 History::~History() { | 38 History::~History() { |
39 data_->RemoveObserver(this); | 39 data_->RemoveObserver(this); |
40 } | 40 } |
41 | 41 |
(...skipping 11 matching lines...) Expand all Loading... | |
53 const std::string& query) const { | 53 const std::string& query) const { |
54 DCHECK(IsReady()); | 54 DCHECK(IsReady()); |
55 return data_->GetKnownResults(NormalizeString(query)); | 55 return data_->GetKnownResults(NormalizeString(query)); |
56 } | 56 } |
57 | 57 |
58 void History::OnHistoryDataLoadedFromStore() { | 58 void History::OnHistoryDataLoadedFromStore() { |
59 data_loaded_ = true; | 59 data_loaded_ = true; |
60 } | 60 } |
61 | 61 |
62 } // namespace app_list | 62 } // namespace app_list |
OLD | NEW |