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

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

Issue 2348183002: App list: Remove search box menu (dead code). (Closed)
Patch Set: Rebase. Created 4 years, 3 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 4e5d44a98753fa7ea75d423800e0673b642d6622..b42be5a39641d298445575b7f9c2adf5ed0a4b81 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -16,7 +16,6 @@
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/app_list/search_box_model.h"
#include "ui/app_list/speech_ui_model.h"
-#include "ui/app_list/views/app_list_menu_views.h"
#include "ui/app_list/views/contents_view.h"
#include "ui/app_list/views/search_box_view_delegate.h"
#include "ui/base/ime/text_input_flags.h"
@@ -26,9 +25,9 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/shadow_value.h"
#include "ui/strings/grit/ui_strings.h"
+#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
-#include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
@@ -46,10 +45,6 @@ const int kPreferredHeight = 48;
const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0);
-// Menu offset relative to the bottom-right corner of the menu button.
-const int kMenuYOffsetFromButton = -4;
-const int kMenuXOffsetFromButton = -7;
-
const int kBackgroundBorderCornerRadius = 2;
// A background that paints a solid white rounded rect with a thin grey border.
@@ -123,7 +118,6 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate,
content_container_(new views::View),
back_button_(NULL),
speech_button_(NULL),
- menu_button_(NULL),
search_box_(new views::Textfield),
contents_view_(NULL),
focused_view_(FOCUS_SEARCH_BOX) {
@@ -159,20 +153,6 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate,
content_container_->AddChildView(search_box_);
layout->SetFlexForView(search_box_, 1);
-#if !defined(OS_CHROMEOS)
- // TODO(mgiuca): Remove the menu (this code doesn't run on non-Chrome-OS so
- // the menu will never be created). https://crbug.com/600915.
- menu_button_ = new views::MenuButton(base::string16(), this, false);
- menu_button_->SetBorder(views::Border::NullBorder());
- menu_button_->SetImage(views::Button::STATE_NORMAL,
- *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL));
- menu_button_->SetImage(views::Button::STATE_HOVERED,
- *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER));
- menu_button_->SetImage(views::Button::STATE_PRESSED,
- *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_PRESSED));
- content_container_->AddChildView(menu_button_);
-#endif
-
view_delegate_->GetSpeechUI()->AddObserver(this);
ModelChanged();
}
@@ -206,10 +186,6 @@ void SearchBoxView::ClearSearch() {
NotifyQueryChanged();
}
-void SearchBoxView::InvalidateMenu() {
- menu_.reset();
-}
-
void SearchBoxView::SetShadow(const gfx::ShadowValue& shadow) {
SetBorder(base::MakeUnique<views::ShadowBorder>(shadow));
Layout();
@@ -321,8 +297,6 @@ bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) {
void SearchBoxView::OnEnabledChanged() {
search_box_->SetEnabled(enabled());
- if (menu_button_)
- menu_button_->SetEnabled(enabled());
if (speech_button_)
speech_button_->SetEnabled(enabled());
}
@@ -408,18 +382,6 @@ void SearchBoxView::ButtonPressed(views::Button* sender,
NOTREACHED();
}
-void SearchBoxView::OnMenuButtonClicked(views::MenuButton* source,
- const gfx::Point& point,
- const ui::Event* event) {
- if (!menu_)
- menu_.reset(new AppListMenuViews(view_delegate_));
-
- const gfx::Point menu_location =
- menu_button_->GetBoundsInScreen().bottom_right() +
- gfx::Vector2d(kMenuXOffsetFromButton, kMenuYOffsetFromButton);
- menu_->RunMenuAt(menu_button_, menu_location);
-}
-
void SearchBoxView::SpeechRecognitionButtonPropChanged() {
const SearchBoxModel::SpeechButtonProperty* speech_button_prop =
model_->search_box()->speech_button();
« 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