| 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/app_list/search_builder.h" | 5 #include "chrome/browser/ui/app_list/search_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 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 profile_ = profile; | 116 profile_ = profile; |
| 117 match_ = match; | 117 match_ = match; |
| 118 UpdateIcon(); | 118 UpdateIcon(); |
| 119 UpdateTitleAndDetails(); | 119 UpdateTitleAndDetails(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 protected: | 122 protected: |
| 123 virtual void UpdateIcon() { | 123 virtual void UpdateIcon() { |
| 124 int resource_id = match_.starred ? | 124 int resource_id = match_.starred ? |
| 125 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 125 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
| 126 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 126 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 127 resource_id)); | 127 resource_id)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 virtual void UpdateTitleAndDetails() { | 130 virtual void UpdateTitleAndDetails() { |
| 131 set_title(match_.contents); | 131 set_title(match_.contents); |
| 132 app_list::SearchResult::Tags title_tags; | 132 app_list::SearchResult::Tags title_tags; |
| 133 ACMatchClassificationsToTags(match_.contents, | 133 ACMatchClassificationsToTags(match_.contents, |
| 134 match_.contents_class, | 134 match_.contents_class, |
| 135 &title_tags); | 135 &title_tags); |
| 136 set_title_tags(title_tags); | 136 set_title_tags(title_tags); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 result->Init(profile_, *it); | 432 result->Init(profile_, *it); |
| 433 results_->Add(result); | 433 results_->Add(result); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 void SearchBuilder::OnResultChanged(bool default_match_changed) { | 437 void SearchBuilder::OnResultChanged(bool default_match_changed) { |
| 438 // TODO(xiyuan): Handle default match properly. | 438 // TODO(xiyuan): Handle default match properly. |
| 439 const AutocompleteResult& ac_result = controller_->result(); | 439 const AutocompleteResult& ac_result = controller_->result(); |
| 440 PopulateFromACResult(ac_result); | 440 PopulateFromACResult(ac_result); |
| 441 } | 441 } |
| OLD | NEW |