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