Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: ui/app_list/search_result_view.cc

Issue 10638018: app_list: Initialize more views in the initializer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/search_box_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/app_list/search_box_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698