Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: chrome/browser/ui/app_list/search/suggestions/suggestions_result.h

Issue 775893005: [AppList] Add a Suggestions Provider to applist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698