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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool History::IsReady() const { | 42 bool History::IsReady() const { |
43 return data_loaded_; | 43 return data_loaded_; |
44 } | 44 } |
45 | 45 |
46 void History::AddLaunchEvent(const std::string& query, | 46 void History::AddLaunchEvent(const std::string& query, |
47 const std::string& result_id) { | 47 const std::string& result_id) { |
48 DCHECK(IsReady()); | 48 DCHECK(IsReady()); |
49 data_->Add(NormalizeString(query), result_id); | 49 data_->Add(NormalizeString(query), result_id); |
50 } | 50 } |
51 | 51 |
52 scoped_ptr<KnownResults> History::GetKnownResults( | 52 std::unique_ptr<KnownResults> History::GetKnownResults( |
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 |