OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ash/app_list/search_builder.h" | 5 #include "chrome/browser/ui/ash/app_list/search_builder.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Overridden from ImageLoadingTracker::Observer: | 155 // Overridden from ImageLoadingTracker::Observer: |
156 virtual void OnImageLoaded(const gfx::Image& image, | 156 virtual void OnImageLoaded(const gfx::Image& image, |
157 const std::string& extension_id, | 157 const std::string& extension_id, |
158 int tracker_index) OVERRIDE { | 158 int tracker_index) OVERRIDE { |
159 if (!image.IsEmpty()) { | 159 if (!image.IsEmpty()) { |
160 SetIcon(*image.ToSkBitmap()); | 160 SetIcon(*image.ToSkBitmap()); |
161 return; | 161 return; |
162 } | 162 } |
163 | 163 |
164 SetIcon(profile_->GetExtensionService()->GetOmniboxPopupIcon(extension_id)); | 164 SetIcon(profile_->GetExtensionService()->GetOmniboxPopupIcon(extension_id). |
| 165 AsImageSkia()); |
165 } | 166 } |
166 | 167 |
167 Profile* profile_; | 168 Profile* profile_; |
168 AutocompleteMatch match_; | 169 AutocompleteMatch match_; |
169 scoped_ptr<ImageLoadingTracker> tracker_; | 170 scoped_ptr<ImageLoadingTracker> tracker_; |
170 | 171 |
171 DISALLOW_COPY_AND_ASSIGN(SearchBuilderResult); | 172 DISALLOW_COPY_AND_ASSIGN(SearchBuilderResult); |
172 }; | 173 }; |
173 | 174 |
174 } // namespace | 175 } // namespace |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ++it) { | 263 ++it) { |
263 results_->Add(new SearchBuilderResult(profile_, *it)); | 264 results_->Add(new SearchBuilderResult(profile_, *it)); |
264 } | 265 } |
265 } | 266 } |
266 | 267 |
267 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 268 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
268 // TODO(xiyuan): Handle default match properly. | 269 // TODO(xiyuan): Handle default match properly. |
269 const AutocompleteResult& ac_result = controller_->result(); | 270 const AutocompleteResult& ac_result = controller_->result(); |
270 PopulateFromACResult(ac_result); | 271 PopulateFromACResult(ac_result); |
271 } | 272 } |
OLD | NEW |