| 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/views/ash/app_list/search_builder.h" | 5 #include "chrome/browser/ui/views/ash/app_list/search_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 int resource_id = match_.starred ? | 118 int resource_id = match_.starred ? |
| 119 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 119 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
| 120 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 120 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 121 resource_id)); | 121 resource_id)); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void LoadExtensionIcon(const extensions::Extension* extension) { | 124 void LoadExtensionIcon(const extensions::Extension* extension) { |
| 125 tracker_.reset(new ImageLoadingTracker(this)); | 125 tracker_.reset(new ImageLoadingTracker(this)); |
| 126 // TODO(xiyuan): Fix this for HD. | 126 tracker_->LoadDIPImage(extension, |
| 127 tracker_->LoadImage(extension, | 127 ExtensionIconSet::EXTENSION_ICON_SMALL, |
| 128 extension->GetIconResource( | 128 gfx::Size(ExtensionIconSet::EXTENSION_ICON_SMALL, |
| 129 ExtensionIconSet::EXTENSION_ICON_SMALL, | 129 ExtensionIconSet::EXTENSION_ICON_SMALL), |
| 130 ExtensionIconSet::MATCH_BIGGER), | 130 ImageLoadingTracker::DONT_CACHE); |
| 131 gfx::Size(ExtensionIconSet::EXTENSION_ICON_SMALL, | |
| 132 ExtensionIconSet::EXTENSION_ICON_SMALL), | |
| 133 ImageLoadingTracker::DONT_CACHE); | |
| 134 } | 131 } |
| 135 | 132 |
| 136 void UpdateTitleAndDetails() { | 133 void UpdateTitleAndDetails() { |
| 137 set_title(match_.contents); | 134 set_title(match_.contents); |
| 138 app_list::SearchResult::Tags title_tags; | 135 app_list::SearchResult::Tags title_tags; |
| 139 ACMatchClassificationsToTags(match_.contents, | 136 ACMatchClassificationsToTags(match_.contents, |
| 140 match_.contents_class, | 137 match_.contents_class, |
| 141 &title_tags); | 138 &title_tags); |
| 142 set_title_tags(title_tags); | 139 set_title_tags(title_tags); |
| 143 | 140 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 ++it) { | 265 ++it) { |
| 269 results_->Add(new SearchBuilderResult(profile_, *it)); | 266 results_->Add(new SearchBuilderResult(profile_, *it)); |
| 270 } | 267 } |
| 271 } | 268 } |
| 272 | 269 |
| 273 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 270 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
| 274 // TODO(xiyuan): Handle default match properly. | 271 // TODO(xiyuan): Handle default match properly. |
| 275 const AutocompleteResult& ac_result = controller_->result(); | 272 const AutocompleteResult& ac_result = controller_->result(); |
| 276 PopulateFromACResult(ac_result); | 273 PopulateFromACResult(ac_result); |
| 277 } | 274 } |
| OLD | NEW |