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 #ifndef UI_APP_LIST_SEARCH_HISTORY_H_ | 5 #ifndef UI_APP_LIST_SEARCH_HISTORY_H_ |
6 #define UI_APP_LIST_SEARCH_HISTORY_H_ | 6 #define UI_APP_LIST_SEARCH_HISTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "components/keyed_service/core/keyed_service.h" | 14 #include "components/keyed_service/core/keyed_service.h" |
15 #include "ui/app_list/app_list_export.h" | 15 #include "ui/app_list/app_list_export.h" |
16 #include "ui/app_list/search/history_data_observer.h" | 16 #include "ui/app_list/search/history_data_observer.h" |
17 #include "ui/app_list/search/history_types.h" | 17 #include "ui/app_list/search/history_types.h" |
18 | 18 |
19 namespace app_list { | 19 namespace app_list { |
20 | 20 |
21 class HistoryData; | 21 class HistoryData; |
22 class HistoryDataStore; | 22 class HistoryDataStore; |
23 | 23 |
(...skipping 14 matching lines...) Expand all Loading... |
38 ~History() override; | 38 ~History() override; |
39 | 39 |
40 // Returns true if the service is ready. | 40 // Returns true if the service is ready. |
41 bool IsReady() const; | 41 bool IsReady() const; |
42 | 42 |
43 // Adds a launch event to the learning data. | 43 // Adds a launch event to the learning data. |
44 void AddLaunchEvent(const std::string& query, const std::string& result_id); | 44 void AddLaunchEvent(const std::string& query, const std::string& result_id); |
45 | 45 |
46 // Gets all known search results that were launched using the given |query| | 46 // Gets all known search results that were launched using the given |query| |
47 // or using queries that |query| is a prefix of. | 47 // or using queries that |query| is a prefix of. |
48 scoped_ptr<KnownResults> GetKnownResults(const std::string& query) const; | 48 std::unique_ptr<KnownResults> GetKnownResults(const std::string& query) const; |
49 | 49 |
50 private: | 50 private: |
51 friend class app_list::test::SearchHistoryTest; | 51 friend class app_list::test::SearchHistoryTest; |
52 | 52 |
53 // HistoryDataObserver overrides: | 53 // HistoryDataObserver overrides: |
54 void OnHistoryDataLoadedFromStore() override; | 54 void OnHistoryDataLoadedFromStore() override; |
55 | 55 |
56 scoped_ptr<HistoryData> data_; | 56 std::unique_ptr<HistoryData> data_; |
57 scoped_refptr<HistoryDataStore> store_; | 57 scoped_refptr<HistoryDataStore> store_; |
58 bool data_loaded_; | 58 bool data_loaded_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(History); | 60 DISALLOW_COPY_AND_ASSIGN(History); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace app_list | 63 } // namespace app_list |
64 | 64 |
65 #endif // UI_APP_LIST_SEARCH_HISTORY_H_ | 65 #endif // UI_APP_LIST_SEARCH_HISTORY_H_ |
OLD | NEW |