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

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

Issue 621823004: Simplifies the structure of app_list search a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/app_list/search/people/people_result.h" 5 #include "chrome/browser/ui/app_list/search/people/people_result.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 break; 102 break;
103 case 1: 103 case 1:
104 SendEmail(); 104 SendEmail();
105 break; 105 break;
106 default: 106 default:
107 LOG(ERROR) << "Invalid people search action: " << action_index; 107 LOG(ERROR) << "Invalid people search action: " << action_index;
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 scoped_ptr<ChromeSearchResult> PeopleResult::Duplicate() { 112 scoped_ptr<SearchResult> PeopleResult::Duplicate() {
113 return scoped_ptr<ChromeSearchResult>( 113 return scoped_ptr<SearchResult>(
114 new PeopleResult(profile_, person_->Duplicate().Pass())).Pass(); 114 new PeopleResult(profile_, person_->Duplicate().Pass()));
115 } 115 }
116 116
117 void PeopleResult::OnIconLoaded() { 117 void PeopleResult::OnIconLoaded() {
118 // Remove the existing image reps since the icon data is loaded and they 118 // Remove the existing image reps since the icon data is loaded and they
119 // need to be re-created. 119 // need to be re-created.
120 const std::vector<gfx::ImageSkiaRep>& image_reps = image_.image_reps(); 120 const std::vector<gfx::ImageSkiaRep>& image_reps = image_.image_reps();
121 for (size_t i = 0; i < image_reps.size(); ++i) 121 for (size_t i = 0; i < image_reps.size(); ++i)
122 image_.RemoveRepresentation(image_reps[i].scale()); 122 image_.RemoveRepresentation(image_reps[i].scale());
123 123
124 SetIcon(image_); 124 SetIcon(image_);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 for (size_t i = 0; i < arraysize(kHangoutsExtensionIds); ++i) { 187 for (size_t i = 0; i < arraysize(kHangoutsExtensionIds); ++i) {
188 if (extensions::EventRouter::Get(profile_)->ExtensionHasEventListener( 188 if (extensions::EventRouter::Get(profile_)->ExtensionHasEventListener(
189 kHangoutsExtensionIds[i], OnHangoutRequested::kEventName)) { 189 kHangoutsExtensionIds[i], OnHangoutRequested::kEventName)) {
190 hangouts_extension_id_ = kHangoutsExtensionIds[i]; 190 hangouts_extension_id_ = kHangoutsExtensionIds[i];
191 return; 191 return;
192 } 192 }
193 } 193 }
194 hangouts_extension_id_.clear(); 194 hangouts_extension_id_.clear();
195 } 195 }
196 196
197 ChromeSearchResultType PeopleResult::GetType() { 197 SearchResultType PeopleResult::GetType() {
198 return SEARCH_PEOPLE_SEARCH_RESULT; 198 return SEARCH_PEOPLE_SEARCH_RESULT;
199 } 199 }
200 200
201 } // namespace app_list 201 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698