| 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 "ui/app_list/search_result_view.h" | 5 #include "ui/app_list/search_result_view.h" |
| 6 | 6 |
| 7 #include "ui/app_list/search_result.h" | 7 #include "ui/app_list/search_result.h" |
| 8 #include "ui/app_list/search_result_list_view.h" | 8 #include "ui/app_list/search_result_list_view.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 namespace app_list { | 86 namespace app_list { |
| 87 | 87 |
| 88 // static | 88 // static |
| 89 const char SearchResultView::kViewClassName[] = "ui/app_list/SearchResultView"; | 89 const char SearchResultView::kViewClassName[] = "ui/app_list/SearchResultView"; |
| 90 | 90 |
| 91 SearchResultView::SearchResultView(SearchResultListView* list_view, | 91 SearchResultView::SearchResultView(SearchResultListView* list_view, |
| 92 views::ButtonListener* listener) | 92 views::ButtonListener* listener) |
| 93 : views::CustomButton(listener), | 93 : views::CustomButton(listener), |
| 94 result_(NULL), | 94 result_(NULL), |
| 95 list_view_(list_view), | 95 list_view_(list_view), |
| 96 icon_(NULL) { | 96 icon_(new IconView) { |
| 97 icon_ = new IconView; | |
| 98 AddChildView(icon_); | 97 AddChildView(icon_); |
| 99 } | 98 } |
| 100 | 99 |
| 101 SearchResultView::~SearchResultView() { | 100 SearchResultView::~SearchResultView() { |
| 102 ClearResultNoRepaint(); | 101 ClearResultNoRepaint(); |
| 103 } | 102 } |
| 104 | 103 |
| 105 void SearchResultView::SetResult(SearchResult* result) { | 104 void SearchResultView::SetResult(SearchResult* result) { |
| 106 ClearResultNoRepaint(); | 105 ClearResultNoRepaint(); |
| 107 | 106 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // Scales down big icons but leave small ones unchanged. | 217 // Scales down big icons but leave small ones unchanged. |
| 219 if (image.width() > kIconDimension || image.height() > kIconDimension) | 218 if (image.width() > kIconDimension || image.height() > kIconDimension) |
| 220 icon_->SetImageSize(gfx::Size(kIconDimension, kIconDimension)); | 219 icon_->SetImageSize(gfx::Size(kIconDimension, kIconDimension)); |
| 221 else | 220 else |
| 222 icon_->ResetImageSize(); | 221 icon_->ResetImageSize(); |
| 223 | 222 |
| 224 icon_->SetImage(image); | 223 icon_->SetImage(image); |
| 225 } | 224 } |
| 226 | 225 |
| 227 } // namespace app_list | 226 } // namespace app_list |
| OLD | NEW |