Index: ui/app_list/views/search_box_view.cc |
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc |
index 7bb48a68e68a1b6bd6f2dec6bc616537c9eda2bf..07979ba456915f174a5b6878c8043e3b5709828d 100644 |
--- a/ui/app_list/views/search_box_view.cc |
+++ b/ui/app_list/views/search_box_view.cc |
@@ -83,13 +83,16 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, |
: delegate_(delegate), |
view_delegate_(view_delegate), |
model_(NULL), |
- icon_view_(new views::ImageView), |
+ icon_view_(NULL), |
speech_button_(NULL), |
search_box_(new views::Textfield), |
contents_view_(NULL) { |
- AddChildView(icon_view_); |
- if (switches::IsExperimentalAppListEnabled()) |
+ if (switches::IsExperimentalAppListEnabled()) { |
set_background(new SearchBoxBackground()); |
+ } else { |
+ icon_view_ = new views::ImageView; |
+ AddChildView(icon_view_); |
+ } |
views::BoxLayout* layout = new views::BoxLayout( |
views::BoxLayout::kHorizontal, kPadding, 0, kPadding); |
@@ -219,7 +222,8 @@ void SearchBoxView::OnMenuButtonClicked(View* source, const gfx::Point& point) { |
} |
void SearchBoxView::IconChanged() { |
- icon_view_->SetImage(model_->search_box()->icon()); |
+ if (icon_view_) |
+ icon_view_->SetImage(model_->search_box()->icon()); |
} |
void SearchBoxView::SpeechRecognitionButtonPropChanged() { |