Chromium Code Reviews| 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 7841388bd63fffa5cdfefc49a25236866a59fb02..2ceb1640788020682a0b4c3609c493efef2834d2 100644 |
| --- a/ui/app_list/views/search_box_view.cc |
| +++ b/ui/app_list/views/search_box_view.cc |
| @@ -182,17 +182,19 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate, |
| search_box_->set_placeholder_text_draw_flags( |
| gfx::Canvas::TEXT_ALIGN_CENTER); |
| search_box_->SetFontList(search_box_->GetFontList().DeriveWithSizeDelta(2)); |
| + } |
| + back_button_ = new SearchBoxImageButton(this); |
| + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| + back_button_->SetImage(views::ImageButton::STATE_NORMAL, |
| + rb.GetImageSkiaNamed(IDR_APP_LIST_FOLDER_BACK_NORMAL)); |
| + back_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| + views::ImageButton::ALIGN_MIDDLE); |
| + SetBackButtonLabel(false); |
| + |
| + if (is_fullscreen_app_list_enabled_) { |
| + content_container_->AddChildView(google_icon_); |
| } else { |
| - back_button_ = new SearchBoxImageButton(this); |
| - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| - back_button_->SetImage( |
| - views::ImageButton::STATE_NORMAL, |
| - rb.GetImageSkiaNamed(IDR_APP_LIST_FOLDER_BACK_NORMAL)); |
| - back_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| - views::ImageButton::ALIGN_MIDDLE); |
| - SetBackButtonLabel(false); |
| content_container_->AddChildView(back_button_); |
| - |
| search_box_->set_placeholder_text_color(kHintTextColor); |
| } |
| content_container_->AddChildView(search_box_); |
| @@ -332,6 +334,22 @@ void SearchBoxView::SetBackButtonLabel(bool folder) { |
| back_button_->SetTooltipText(back_button_label); |
| } |
| +void SearchBoxView::SwapGoogleIconWithBackButton(bool show_back_button) { |
|
vadimt
2017/06/22 00:36:12
"ShowBackOrGoogleIcon"
BTW, do we show Google ico
newcomer
2017/06/22 16:49:07
Done, and I opened a dialogue with our pm/ux crew.
|
| + if (!is_fullscreen_app_list_enabled_) |
| + return; |
| + |
| + if (show_back_button) { |
| + content_container_->AddChildViewAt( |
| + back_button_, content_container_->GetIndexOf(google_icon_)); |
| + content_container_->RemoveChildView(google_icon_); |
| + } else { |
| + content_container_->AddChildViewAt( |
| + google_icon_, content_container_->GetIndexOf(back_button_)); |
| + content_container_->RemoveChildView(back_button_); |
| + } |
| + content_container_->Layout(); |
| +} |
| + |
| bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
| if (contents_view_) |
| return contents_view_->OnMouseWheel(event); |