OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_RESULT_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_RESULT_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/suggestions/proto/suggestions.pb.h" |
| 10 #include "ui/app_list/search_result.h" |
| 11 |
| 12 class AppListControllerDelegate; |
| 13 class GURL; |
| 14 class Profile; |
| 15 class SkBitmap; |
| 16 |
| 17 namespace suggestions { |
| 18 class SuggestionsService; |
| 19 } // namespace suggestions |
| 20 |
| 21 namespace app_list { |
| 22 |
| 23 class SuggestionsResult : public SearchResult { |
| 24 public: |
| 25 SuggestionsResult(Profile* profile, |
| 26 AppListControllerDelegate* list_controller, |
| 27 suggestions::SuggestionsService* suggestions_service, |
| 28 const suggestions::ChromeSuggestion& suggestion, int index); |
| 29 ~SuggestionsResult() override; |
| 30 |
| 31 // SearchResult overrides: |
| 32 void Open(int event_flags) override; |
| 33 scoped_ptr<SearchResult> Duplicate() override; |
| 34 |
| 35 private: |
| 36 void UpdateIcon(); |
| 37 void OnSuggestionsThumbnailAvailable(const GURL& url, const SkBitmap* bitmap); |
| 38 |
| 39 Profile* profile_; |
| 40 AppListControllerDelegate* list_controller_; |
| 41 suggestions::SuggestionsService* suggestions_service_; |
| 42 suggestions::ChromeSuggestion suggestion_; |
| 43 int index_; |
| 44 |
| 45 // For callbacks may be run after destruction. |
| 46 base::WeakPtrFactory<SuggestionsResult> weak_ptr_factory_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(SuggestionsResult); |
| 49 }; |
| 50 |
| 51 } // namespace app_list |
| 52 |
| 53 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_RESULT_H_ |
OLD | NEW |