OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/home/athena_start_page_view.h" | 5 #include "athena/home/athena_start_page_view.h" |
6 | 6 |
7 #include "athena/home/home_card_constants.h" | 7 #include "athena/home/home_card_constants.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "third_party/skia/include/core/SkPaint.h" | 10 #include "third_party/skia/include/core/SkPaint.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 control_icon_container_->SetFillsBoundsOpaquely(false); | 204 control_icon_container_->SetFillsBoundsOpaquely(false); |
205 AddChildView(control_icon_container_); | 205 AddChildView(control_icon_container_); |
206 control_icon_container_->SetLayoutManager(new views::BoxLayout( | 206 control_icon_container_->SetLayoutManager(new views::BoxLayout( |
207 views::BoxLayout::kHorizontal, 0, 0, kIconMargin)); | 207 views::BoxLayout::kHorizontal, 0, 0, kIconMargin)); |
208 for (size_t i = 0; i < kMaxIconNum; ++i) | 208 for (size_t i = 0; i < kMaxIconNum; ++i) |
209 control_icon_container_->AddChildView(new PlaceHolderButton()); | 209 control_icon_container_->AddChildView(new PlaceHolderButton()); |
210 control_icon_container_->SetSize(control_icon_container_->GetPreferredSize()); | 210 control_icon_container_->SetSize(control_icon_container_->GetPreferredSize()); |
211 | 211 |
212 search_box_view_ = new app_list::SearchBoxView(this, view_delegate); | 212 search_box_view_ = new app_list::SearchBoxView(this, view_delegate); |
213 search_box_view_->set_contents_view(this); | 213 search_box_view_->set_contents_view(this); |
| 214 search_box_view_->search_box()->set_id(kHomeCardSearchBoxId); |
214 search_box_container_ = new SearchBoxContainer(search_box_view_); | 215 search_box_container_ = new SearchBoxContainer(search_box_view_); |
215 search_box_container_->SetPaintToLayer(true); | 216 search_box_container_->SetPaintToLayer(true); |
216 search_box_container_->SetFillsBoundsOpaquely(false); | 217 search_box_container_->SetFillsBoundsOpaquely(false); |
217 search_box_container_->SetSize(search_box_container_->GetPreferredSize()); | 218 search_box_container_->SetSize(search_box_container_->GetPreferredSize()); |
218 AddChildView(search_box_container_); | 219 AddChildView(search_box_container_); |
219 } | 220 } |
220 | 221 |
221 AthenaStartPageView::~AthenaStartPageView() {} | 222 AthenaStartPageView::~AthenaStartPageView() {} |
222 | 223 |
223 void AthenaStartPageView::RequestFocusOnSearchBox() { | 224 void AthenaStartPageView::RequestFocusOnSearchBox() { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 base::TrimWhitespace( | 396 base::TrimWhitespace( |
396 delegate_->GetModel()->search_box()->text(), base::TRIM_ALL, &query); | 397 delegate_->GetModel()->search_box()->text(), base::TRIM_ALL, &query); |
397 | 398 |
398 if (!query.empty()) | 399 if (!query.empty()) |
399 search_results_view_->SetSelectedIndex(0); | 400 search_results_view_->SetSelectedIndex(0); |
400 | 401 |
401 LayoutSearchResults(!query.empty()); | 402 LayoutSearchResults(!query.empty()); |
402 } | 403 } |
403 | 404 |
404 } // namespace athena | 405 } // namespace athena |
OLD | NEW |