OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/task/cancelable_task_tracker.h" | 11 #include "base/task/cancelable_task_tracker.h" |
11 #include "components/suggestions/proto/suggestions.pb.h" | 12 #include "components/suggestions/proto/suggestions.pb.h" |
12 #include "ui/app_list/search_result.h" | 13 #include "ui/app_list/search_result.h" |
13 | 14 |
14 class AppListControllerDelegate; | 15 class AppListControllerDelegate; |
15 class GURL; | 16 class GURL; |
16 class Profile; | 17 class Profile; |
17 class SkBitmap; | 18 class SkBitmap; |
18 | 19 |
19 namespace favicon { | 20 namespace favicon { |
(...skipping 16 matching lines...) Expand all Loading... |
36 // is expected to live longer that |suggestion|. | 37 // is expected to live longer that |suggestion|. |
37 URLSuggestionResult(Profile* profile, | 38 URLSuggestionResult(Profile* profile, |
38 AppListControllerDelegate* list_controller, | 39 AppListControllerDelegate* list_controller, |
39 favicon::FaviconService* favicon_service, | 40 favicon::FaviconService* favicon_service, |
40 suggestions::SuggestionsService* suggestions_service, | 41 suggestions::SuggestionsService* suggestions_service, |
41 const suggestions::ChromeSuggestion& suggestion); | 42 const suggestions::ChromeSuggestion& suggestion); |
42 ~URLSuggestionResult() override; | 43 ~URLSuggestionResult() override; |
43 | 44 |
44 // SearchResult overrides: | 45 // SearchResult overrides: |
45 void Open(int event_flags) override; | 46 void Open(int event_flags) override; |
46 scoped_ptr<SearchResult> Duplicate() const override; | 47 std::unique_ptr<SearchResult> Duplicate() const override; |
47 | 48 |
48 // Refer to SearchResult::set_relevance for documentation. | 49 // Refer to SearchResult::set_relevance for documentation. |
49 using SearchResult::set_relevance; | 50 using SearchResult::set_relevance; |
50 | 51 |
51 private: | 52 private: |
52 void UpdateIcon(); | 53 void UpdateIcon(); |
53 void OnDidGetIcon( | 54 void OnDidGetIcon( |
54 const favicon_base::FaviconRawBitmapResult& bitmap_result); | 55 const favicon_base::FaviconRawBitmapResult& bitmap_result); |
55 void OnSuggestionsThumbnailAvailable(const GURL& url, const SkBitmap* bitmap); | 56 void OnSuggestionsThumbnailAvailable(const GURL& url, const SkBitmap* bitmap); |
56 | 57 |
57 Profile* profile_; | 58 Profile* profile_; |
58 AppListControllerDelegate* list_controller_; | 59 AppListControllerDelegate* list_controller_; |
59 favicon::FaviconService* favicon_service_; | 60 favicon::FaviconService* favicon_service_; |
60 suggestions::SuggestionsService* suggestions_service_; | 61 suggestions::SuggestionsService* suggestions_service_; |
61 suggestions::ChromeSuggestion suggestion_; | 62 suggestions::ChromeSuggestion suggestion_; |
62 scoped_ptr<base::CancelableTaskTracker> cancelable_task_tracker_; | 63 std::unique_ptr<base::CancelableTaskTracker> cancelable_task_tracker_; |
63 | 64 |
64 // For callbacks that may be run after destruction. | 65 // For callbacks that may be run after destruction. |
65 base::WeakPtrFactory<URLSuggestionResult> weak_ptr_factory_; | 66 base::WeakPtrFactory<URLSuggestionResult> weak_ptr_factory_; |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(URLSuggestionResult); | 68 DISALLOW_COPY_AND_ASSIGN(URLSuggestionResult); |
68 }; | 69 }; |
69 | 70 |
70 } // namespace app_list | 71 } // namespace app_list |
71 | 72 |
72 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H
_ | 73 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_URL_SUGGESTION_RESULT_H
_ |
OLD | NEW |