Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 4eee58e13c526ee7dd87fb43e2e0dd23b1dd1ee8..0946995922ba8d19cb4bee0d1a7b833ae86dd775 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -138,7 +138,6 @@ LocationBarView::LocationBarView(Browser* browser, |
| selected_keyword_view_(NULL), |
| suggested_text_view_(NULL), |
| keyword_hint_view_(NULL), |
| - mic_search_view_(NULL), |
| zoom_view_(NULL), |
| open_pdf_in_reader_view_(NULL), |
| manage_passwords_icon_view_(NULL), |
| @@ -156,9 +155,6 @@ LocationBarView::LocationBarView(Browser* browser, |
| base::Bind(&LocationBarView::UpdateWithoutTabRestore, |
| base::Unretained(this))); |
| - if (browser_) |
| - browser_->search_model()->AddObserver(this); |
| - |
| ui_zoom::ZoomEventManager::GetForBrowserContext(profile) |
| ->AddZoomEventManagerObserver(this); |
| @@ -172,8 +168,6 @@ LocationBarView::LocationBarView(Browser* browser, |
| LocationBarView::~LocationBarView() { |
| if (template_url_service_) |
| template_url_service_->RemoveObserver(this); |
| - if (browser_) |
| - browser_->search_model()->RemoveObserver(this); |
| ui_zoom::ZoomEventManager::GetForBrowserContext(profile()) |
| ->RemoveZoomEventManagerObserver(this); |
| @@ -281,20 +275,6 @@ void LocationBarView::Init() { |
| background_color); |
| AddChildView(keyword_hint_view_); |
| - mic_search_view_ = new views::ImageButton(this); |
| - mic_search_view_->set_id(VIEW_ID_MIC_SEARCH_BUTTON); |
| - mic_search_view_->SetAccessibilityFocusable(true); |
| - mic_search_view_->SetTooltipText( |
| - l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); |
|
msw
2015/11/06 23:59:23
Remove IDS_TOOLTIP_MIC_SEARCH and other uses?
Evan Stade
2015/11/07 00:43:03
no, this tooltip is used in the cros app list
|
| - mic_search_view_->SetImage( |
| - views::Button::STATE_NORMAL, |
| - ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| - IDR_OMNIBOX_MIC_SEARCH)); |
| - mic_search_view_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
| - views::ImageButton::ALIGN_MIDDLE); |
| - mic_search_view_->SetVisible(false); |
| - AddChildView(mic_search_view_); |
| - |
| const SkColor text_color = GetColor(SecurityStateModel::NONE, TEXT); |
| for (ContentSettingsType type : |
| ContentSettingBubbleModel::GetSupportedBubbleTypes()) { |
| @@ -588,8 +568,7 @@ gfx::Size LocationBarView::GetPreferredSize() const { |
| IncrementalMinimumWidth(open_pdf_in_reader_view_) + |
| IncrementalMinimumWidth(save_credit_card_icon_view_) + |
| IncrementalMinimumWidth(manage_passwords_icon_view_) + |
| - IncrementalMinimumWidth(zoom_view_) + |
| - IncrementalMinimumWidth(mic_search_view_); |
| + IncrementalMinimumWidth(zoom_view_); |
| for (PageActionViews::const_iterator i(page_action_views_.begin()); |
| i != page_action_views_.end(); ++i) |
| trailing_width += IncrementalMinimumWidth((*i)); |
| @@ -712,10 +691,6 @@ void LocationBarView::Layout() { |
| *i); |
| } |
| } |
| - if (mic_search_view_->visible()) { |
| - trailing_decorations.AddDecoration(vertical_padding, location_height, |
| - mic_search_view_); |
| - } |
| // Because IMEs may eat the tab key, we don't show "press tab to search" while |
| // IME composition is in progress. |
| if (!keyword.empty() && omnibox_view_->model()->is_keyword_hint() && |
| @@ -826,9 +801,6 @@ void LocationBarView::Layout() { |
| } |
| void LocationBarView::Update(const WebContents* contents) { |
| - mic_search_view_->SetVisible( |
| - !GetToolbarModel()->input_in_progress() && browser_ && |
| - browser_->search_model()->voice_search_supported()); |
| RefreshContentSettingViews(); |
| RefreshZoomView(); |
| RefreshPageActionViews(); |
| @@ -1341,15 +1313,6 @@ void LocationBarView::PaintChildren(const ui::PaintContext& context) { |
| } |
| //////////////////////////////////////////////////////////////////////////////// |
| -// LocationBarView, private views::ButtonListener implementation: |
| - |
| -void LocationBarView::ButtonPressed(views::Button* sender, |
| - const ui::Event& event) { |
| - DCHECK_EQ(mic_search_view_, sender); |
| - command_updater()->ExecuteCommand(IDC_TOGGLE_SPEECH_INPUT); |
|
msw
2015/11/06 23:59:23
Remove IDC_TOGGLE_SPEECH_INPUT and uses?
|
| -} |
| - |
| -//////////////////////////////////////////////////////////////////////////////// |
| // LocationBarView, private views::DragController implementation: |
| void LocationBarView::WriteDragDataForView(views::View* sender, |
| @@ -1438,16 +1401,3 @@ void LocationBarView::OnTemplateURLServiceChanged() { |
| if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| ShowFirstRunBubble(); |
| } |
| - |
| -//////////////////////////////////////////////////////////////////////////////// |
| -// LocationBarView, private SearchModelObserver implementation: |
| - |
| -void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| - const SearchModel::State& new_state) { |
| - const bool visible = !GetToolbarModel()->input_in_progress() && |
| - new_state.voice_search_supported; |
| - if (mic_search_view_->visible() != visible) { |
| - mic_search_view_->SetVisible(visible); |
| - Layout(); |
| - } |
| -} |