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