158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// found in the LICENSE file. 458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ 658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#define CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ 758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include <string> 958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 1058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "base/basictypes.h" 1158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "base/memory/weak_ptr.h" 1258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "chrome/browser/ui/app_list/search/chrome_search_result.h" 1358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "url/gurl.h" 1458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 1558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)class Profile; 1658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 1758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)namespace app_list { 1858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)struct Person; 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 2158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)class PeopleResult : public ChromeSearchResult { 2258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) public: 234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) PeopleResult(Profile* profile, scoped_ptr<Person> person); 2458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual ~PeopleResult(); 2558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 2658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // ChromeSearchResult overides: 2758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual void Open(int event_flags) OVERRIDE; 2858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual void InvokeAction(int action_index, int event_flags) OVERRIDE; 2958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual scoped_ptr<ChromeSearchResult> Duplicate() OVERRIDE; 3058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual ChromeSearchResultType GetType() OVERRIDE; 3158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 3258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) private: 3358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) void OnIconLoaded(); 3468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) void SetDefaultActions(); 354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void OpenChat(); 3668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) void SendEmail(); 3758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 388bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // Check if we have any variant of the hangouts extension installed and 398bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // waiting on the onHangoutRequested event (the hangouts extension can have 408bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // a total of four possible id's, depending on which release type of it is 418bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // installed). If so, set the hangouts_extension_id_ to the id of the 428bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // extension that is waiting, or set it to an empty string if not. 438bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) void RefreshHangoutsExtensionId(); 444e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 4558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) Profile* profile_; 464e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) scoped_ptr<Person> person_; 4758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 4858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) gfx::ImageSkia image_; 4958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) base::WeakPtrFactory<PeopleResult> weak_factory_; 5058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 518bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) // Caches the id of the hangouts extension. 528bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) std::string hangouts_extension_id_; 534e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 5458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(PeopleResult); 5558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)}; 5658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 5758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)} // namespace app_list 5858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 5958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PEOPLE_PEOPLE_RESULT_H_ 60