Chromium Code Reviews| 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" | |
|
huangs
2014/12/03 20:36:11
Forward-declare AppListControllerDelegate instead?
Mathieu
2014/12/03 21:01:30
Done.
| |
| 9 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | |
|
huangs
2014/12/03 20:36:11
Forward-declare AppListControllerDelegate instead?
Mathieu
2014/12/03 21:01:30
Done.
| |
| 10 #include "components/suggestions/proto/suggestions.pb.h" | |
| 11 #include "components/suggestions/suggestions_service.h" | |
|
huangs
2014/12/03 20:36:11
Forward-declare suggestions::SuggestionsService in
Mathieu
2014/12/03 21:01:30
Done.
| |
| 12 #include "ui/app_list/search_result.h" | |
| 13 | |
| 14 class GURL; | |
| 15 class Profile; | |
| 16 class SkBitmap; | |
| 17 | |
| 18 namespace app_list { | |
| 19 | |
| 20 class SuggestionsResult : public SearchResult { | |
| 21 public: | |
| 22 SuggestionsResult(Profile* profile, | |
| 23 AppListControllerDelegate* list_controller, | |
| 24 suggestions::SuggestionsService* suggestions_service, | |
| 25 const suggestions::ChromeSuggestion suggestion, | |
|
huangs
2014/12/03 20:36:11
Missing "&" for const ?
Mathieu
2014/12/03 21:01:30
Done.
| |
| 26 int index); | |
| 27 ~SuggestionsResult() override; | |
| 28 | |
| 29 // SearchResult overrides: | |
| 30 void Open(int event_flags) override; | |
| 31 scoped_ptr<SearchResult> Duplicate() override; | |
| 32 | |
| 33 private: | |
| 34 void UpdateIcon(); | |
| 35 void OnSuggestionsThumbnailAvailable(const GURL& url, const SkBitmap* bitmap); | |
| 36 | |
| 37 Profile* profile_; | |
| 38 AppListControllerDelegate* list_controller_; | |
| 39 suggestions::SuggestionsService* suggestions_service_; | |
| 40 suggestions::ChromeSuggestion suggestion_; | |
| 41 int index_; | |
| 42 | |
| 43 // For callbacks may be run after destruction. | |
| 44 base::WeakPtrFactory<SuggestionsResult> weak_ptr_factory_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(SuggestionsResult); | |
| 47 }; | |
| 48 | |
| 49 } // namespace app_list | |
| 50 | |
| 51 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SUGGESTIONS_SUGGESTIONS_RESULT_H_ | |
| OLD | NEW |