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

Unified Diff: chrome/browser/ui/app_list/search/people/people_result.cc

Issue 644863002: Introduce OpenURL to AppListControllerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/people/people_result.cc
diff --git a/chrome/browser/ui/app_list/search/people/people_result.cc b/chrome/browser/ui/app_list/search/people/people_result.cc
index 6278313bf226a3d15677b9273235589d3ce51ada..6735cfe91447e4324557e6f0553853afc813a072 100644
--- a/chrome/browser/ui/app_list/search/people/people_result.cc
+++ b/chrome/browser/ui/app_list/search/people/people_result.cc
@@ -12,10 +12,10 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/search/common/url_icon_source.h"
#include "chrome/browser/ui/app_list/search/people/person.h"
#include "chrome/browser/ui/app_list/search/search_util.h"
-#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/common/extensions/api/hangouts_private.h"
#include "chrome/grit/generated_resources.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
@@ -61,8 +61,13 @@ GURL GetImageUrl(const GURL& url) {
namespace app_list {
-PeopleResult::PeopleResult(Profile* profile, scoped_ptr<Person> person)
- : profile_(profile), person_(person.Pass()), weak_factory_(this) {
+PeopleResult::PeopleResult(Profile* profile,
+ AppListControllerDelegate* controller,
+ scoped_ptr<Person> person)
+ : profile_(profile),
+ controller_(controller),
+ person_(person.Pass()),
+ weak_factory_(this) {
set_id(person_->id);
set_title(base::UTF8ToUTF16(person_->display_name));
set_relevance(person_->interaction_rank);
@@ -114,7 +119,7 @@ void PeopleResult::InvokeAction(int action_index, int event_flags) {
scoped_ptr<SearchResult> PeopleResult::Duplicate() {
return scoped_ptr<SearchResult>(
- new PeopleResult(profile_, person_->Duplicate().Pass()));
+ new PeopleResult(profile_, controller_, person_->Duplicate().Pass()));
}
void PeopleResult::OnIconLoaded() {
@@ -175,12 +180,10 @@ void PeopleResult::OpenChat() {
}
void PeopleResult::SendEmail() {
- chrome::NavigateParams params(profile_,
- GURL(kEmailUrlPrefix + person_->email),
- ui::PAGE_TRANSITION_LINK);
- // If no window exists, this will open a new window this one tab.
- params.disposition = NEW_FOREGROUND_TAB;
- chrome::Navigate(&params);
+ controller_->OpenURL(profile_,
+ GURL(kEmailUrlPrefix + person_->email),
+ ui::PAGE_TRANSITION_LINK,
+ NEW_FOREGROUND_TAB);
content::RecordAction(base::UserMetricsAction("PeopleSearch_SendEmail"));
}

Powered by Google App Engine
This is Rietveld 408576698