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 CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "ui/app_list/search_result.h" | 12 #include "ui/app_list/search_result.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
| 15 class AppListControllerDelegate; |
15 class Profile; | 16 class Profile; |
16 | 17 |
17 namespace app_list { | 18 namespace app_list { |
18 | 19 |
19 struct Person; | 20 struct Person; |
20 | 21 |
21 class PeopleResult : public SearchResult { | 22 class PeopleResult : public SearchResult { |
22 public: | 23 public: |
23 PeopleResult(Profile* profile, scoped_ptr<Person> person); | 24 PeopleResult(Profile* profile, |
| 25 AppListControllerDelegate* controller, |
| 26 scoped_ptr<Person> person); |
24 virtual ~PeopleResult(); | 27 virtual ~PeopleResult(); |
25 | 28 |
26 // SearchResult overrides: | 29 // SearchResult overrides: |
27 virtual void Open(int event_flags) override; | 30 virtual void Open(int event_flags) override; |
28 virtual void InvokeAction(int action_index, int event_flags) override; | 31 virtual void InvokeAction(int action_index, int event_flags) override; |
29 virtual scoped_ptr<SearchResult> Duplicate() override; | 32 virtual scoped_ptr<SearchResult> Duplicate() override; |
30 | 33 |
31 private: | 34 private: |
32 void OnIconLoaded(); | 35 void OnIconLoaded(); |
33 void SetDefaultActions(); | 36 void SetDefaultActions(); |
34 void OpenChat(); | 37 void OpenChat(); |
35 void SendEmail(); | 38 void SendEmail(); |
36 | 39 |
37 // Check if we have any variant of the hangouts extension installed and | 40 // Check if we have any variant of the hangouts extension installed and |
38 // waiting on the onHangoutRequested event (the hangouts extension can have | 41 // waiting on the onHangoutRequested event (the hangouts extension can have |
39 // a total of four possible id's, depending on which release type of it is | 42 // a total of four possible id's, depending on which release type of it is |
40 // installed). If so, set the hangouts_extension_id_ to the id of the | 43 // installed). If so, set the hangouts_extension_id_ to the id of the |
41 // extension that is waiting, or set it to an empty string if not. | 44 // extension that is waiting, or set it to an empty string if not. |
42 void RefreshHangoutsExtensionId(); | 45 void RefreshHangoutsExtensionId(); |
43 | 46 |
44 Profile* profile_; | 47 Profile* profile_; |
| 48 AppListControllerDelegate* controller_; |
45 scoped_ptr<Person> person_; | 49 scoped_ptr<Person> person_; |
46 | 50 |
47 gfx::ImageSkia image_; | 51 gfx::ImageSkia image_; |
48 | 52 |
49 // Caches the id of the hangouts extension. | 53 // Caches the id of the hangouts extension. |
50 std::string hangouts_extension_id_; | 54 std::string hangouts_extension_id_; |
51 | 55 |
52 base::WeakPtrFactory<PeopleResult> weak_factory_; | 56 base::WeakPtrFactory<PeopleResult> weak_factory_; |
53 | 57 |
54 DISALLOW_COPY_AND_ASSIGN(PeopleResult); | 58 DISALLOW_COPY_AND_ASSIGN(PeopleResult); |
55 }; | 59 }; |
56 | 60 |
57 } // namespace app_list | 61 } // namespace app_list |
58 | 62 |
59 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ | 63 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ |
OLD | NEW |