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

Unified Diff: ui/app_list/views/search_box_view.cc

Issue 2951903004: Added back button when in folder view. (Closed)
Patch Set: Added back button when in folder view. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bf45f58188373b48ee3fac5b3759efaf1f3bb928 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -182,17 +182,20 @@ 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);
+ content_container_->AddChildView(back_button_);
+ if (is_fullscreen_app_list_enabled_) {
+ content_container_->AddChildView(google_icon_);
+ content_container_->child_at(content_container_->GetIndexOf(back_button_))
+ ->SetVisible(false);
} 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 +335,19 @@ void SearchBoxView::SetBackButtonLabel(bool folder) {
back_button_->SetTooltipText(back_button_label);
}
+void SearchBoxView::ShowBackOrGoogleIcon(bool show_back_button) {
+ if (!is_fullscreen_app_list_enabled_)
+ return;
+
+ int google_icon_index = content_container_->GetIndexOf(google_icon_);
vadimt 2017/06/24 00:16:26 Converting to index and back to view.
newcomer 2017/06/24 00:50:05 Acknowledged.
+ int back_button_index = content_container_->GetIndexOf(back_button_);
+ content_container_->child_at(google_icon_index)
+ ->SetVisible(show_back_button ? false : true);
vadimt 2017/06/24 00:16:26 !show_back_button
newcomer 2017/06/24 00:50:05 Done.
+ content_container_->child_at(back_button_index)
+ ->SetVisible(show_back_button ? true : false);
vadimt 2017/06/24 00:16:26 show_back_button ? true : false => show_back_butto
newcomer 2017/06/24 00:50:05 Done.
+ content_container_->Layout();
+}
+
bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) {
if (contents_view_)
return contents_view_->OnMouseWheel(event);
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698