people_result.h revision 58537e28ecd584eab876aee8be7156509866d23a
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 "chrome/browser/ui/app_list/search/chrome_search_result.h" 13#include "url/gurl.h" 14 15class Profile; 16 17namespace app_list { 18 19class PeopleResult : public ChromeSearchResult { 20 public: 21 PeopleResult(Profile* profile, 22 const std::string& id, 23 const std::string& display_name, 24 double interaction_rank, 25 const GURL& image_url); 26 virtual ~PeopleResult(); 27 28 // ChromeSearchResult overides: 29 virtual void Open(int event_flags) OVERRIDE; 30 virtual void InvokeAction(int action_index, int event_flags) OVERRIDE; 31 virtual scoped_ptr<ChromeSearchResult> Duplicate() OVERRIDE; 32 virtual ChromeSearchResultType GetType() OVERRIDE; 33 34 private: 35 void SetDefaultDetails(); 36 void OnIconLoaded(); 37 38 Profile* profile_; 39 const std::string id_; 40 const std::string display_name_; 41 const double interaction_rank_; 42 const GURL image_url_; 43 44 gfx::ImageSkia image_; 45 base::WeakPtrFactory<PeopleResult> weak_factory_; 46 47 DISALLOW_COPY_AND_ASSIGN(PeopleResult); 48}; 49 50} // namespace app_list 51 52#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ 53