diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 01:56:17 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 01:56:17 +0000 |
commit | 3520cbaffa294b556b0303b75dd048ad755d2df2 (patch) | |
tree | 4ff3d6f3eff1469c1bb93779c0712d679c30d712 | |
parent | 409126c6cd6312806dcd156e18563c8e747c81c7 (diff) | |
download | chromium_src-3520cbaffa294b556b0303b75dd048ad755d2df2.zip chromium_src-3520cbaffa294b556b0303b75dd048ad755d2df2.tar.gz chromium_src-3520cbaffa294b556b0303b75dd048ad755d2df2.tar.bz2 |
Revert 211740 "Add mic icon in omnibox to trigger voice search. ..."
> Add mic icon in omnibox to trigger voice search. This appears only when the
> underlying page uses the setVoiceSearchSupported() JS API to indicate it
> supports voice search.
>
> BUG=251386
> TEST=With instant extended on, browser to a search result page; should see mic icon that, when clicked, activates voice search
> R=dmazzoni@chromium.org, sky@chromium.org
>
> Review URL: https://codereview.chromium.org/18596002
TBR=pkasting@chromium.org
Review URL: https://codereview.chromium.org/19323002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211753 0039d316-1c4b-4281-b951-d872f2087c98
13 files changed, 83 insertions, 176 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 16d2d0d..e8aca6c 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -7983,9 +7983,6 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_TOOLTIP_ACTION_BOX_BUTTON" desc="The tooltip for action box button"> Actions </message> - <message name="IDS_TOOLTIP_MIC_SEARCH" desc="The tooltip for search-by-voice button"> - Voice search - </message> <message name="IDS_TOOLTIP_ZOOM" desc="The tooltip for zoom icon"> Zoom: <ph name="VALUE">$1<ex>100</ex></ph>% </message> @@ -8041,6 +8038,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ACCNAME_LOCATION" desc="The accessible name for the editable-text portion of the omnibox."> Address and search bar </message> + <message name="IDS_ACCNAME_STAR" desc="The accessible name for the bookmark button."> + Bookmark + </message> <message name="IDS_ACCNAME_ZOOM" desc="The accessible name for the zoom button."> Zoom </message> diff --git a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm index 6fcafbc..3cf0dc9 100644 --- a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm +++ b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm @@ -70,8 +70,7 @@ class ViewIDTest : public InProcessBrowserTest { if (i == VIEW_ID_STAR_BUTTON || i == VIEW_ID_CONTENTS_SPLIT || i == VIEW_ID_FEEDBACK_BUTTON || - i == VIEW_ID_SCRIPT_BUBBLE || - i == VIEW_ID_MIC_SEARCH_BUTTON) { + i == VIEW_ID_SCRIPT_BUBBLE) { continue; } diff --git a/chrome/browser/ui/gtk/view_id_util_browsertest.cc b/chrome/browser/ui/gtk/view_id_util_browsertest.cc index 9e71fcd..b3f1b03 100644 --- a/chrome/browser/ui/gtk/view_id_util_browsertest.cc +++ b/chrome/browser/ui/gtk/view_id_util_browsertest.cc @@ -44,8 +44,7 @@ IN_PROC_BROWSER_TEST_F(ViewIDTest, Basic) { i == VIEW_ID_BOOKMARK_BAR_ELEMENT || i == VIEW_ID_TAB || i == VIEW_ID_FEEDBACK_BUTTON || - i == VIEW_ID_SCRIPT_BUBBLE || - i == VIEW_ID_MIC_SEARCH_BUTTON) { + i == VIEW_ID_SCRIPT_BUBBLE) { continue; } diff --git a/chrome/browser/ui/view_ids.h b/chrome/browser/ui/view_ids.h index 5d792c9..35dda47 100644 --- a/chrome/browser/ui/view_ids.h +++ b/chrome/browser/ui/view_ids.h @@ -76,10 +76,7 @@ enum ViewID { VIEW_ID_ZOOM_BUTTON, #endif - // The omnibox icon to do voice-based search. - VIEW_ID_MIC_SEARCH_BUTTON, - - // Used in chrome/browser/ui/gtk/view_id_util_browsertest.cc + // Used in chrome/browser/ui/gtk/view_id_util_browsertests.cc // If you add new ids, make sure the above test passes. VIEW_ID_PREDEFINED_COUNT, diff --git a/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc b/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc index ca7270c..1094b7e 100644 --- a/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc +++ b/chrome/browser/ui/views/accessibility/browser_views_accessibility_browsertest.cc @@ -136,34 +136,35 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, // Retrieve accessibility object for non client view and verify accessibility // info. -// TODO(pkasting): Disabled pending resolution of whether this should be -// ROLE_SYSTEM_CLIENT or ROLE_SYSTEM_WINDOW. +// http://crbug.com/104132 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, DISABLED_TestNonClientViewAccObj) { - TestViewAccessibilityObject( - GetBrowserView()->GetWidget()->non_client_view(), + views::View* non_client_view = + GetBrowserView()->GetWidget()->non_client_view(); + + TestViewAccessibilityObject(non_client_view, UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), ROLE_SYSTEM_WINDOW); } -// Retrieve accessibility object for browser root view and verify accessibility -// info. -// TODO(pkasting): Disabled pending resolution of whether this should be -// ROLE_SYSTEM_WINDOW or ROLE_SYSTEM_APPLICATION, as well as what the name -// should be. +// Retrieve accessibility object for browser root view and verify +// accessibility info. +// http://crbug.com/104132 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, DISABLED_TestBrowserRootViewAccObj) { + views::View* browser_root_view = GetBrowserView()->frame()->GetRootView(); + TestViewAccessibilityObject( - GetBrowserView()->frame()->GetRootView(), + browser_root_view, UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), ROLE_SYSTEM_APPLICATION); } // Retrieve accessibility object for browser view and verify accessibility info. -// TODO(pkasting): Disabled pending resolution of whether this object should -// have an accessible name. +// http://crbug.com/104132 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, DISABLED_TestBrowserViewAccObj) { + // Verify root view MSAA name and role. TestViewAccessibilityObject( GetBrowserView(), UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), @@ -171,7 +172,10 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, } // Retrieve accessibility object for toolbar view and verify accessibility info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestToolbarViewAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestToolbarViewAccObj) { + // Verify toolbar MSAA name and role. TestViewAccessibilityObject( GetToolbarView(), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)), @@ -179,7 +183,10 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestToolbarViewAccObj) { } // Retrieve accessibility object for Back button and verify accessibility info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestBackButtonAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestBackButtonAccObj) { + // Verify Back button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_BACK_BUTTON), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)), @@ -188,7 +195,10 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestBackButtonAccObj) { // Retrieve accessibility object for Forward button and verify accessibility // info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestForwardButtonAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestForwardButtonAccObj) { + // Verify Forward button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_FORWARD_BUTTON), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)), @@ -197,7 +207,10 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestForwardButtonAccObj) { // Retrieve accessibility object for Reload button and verify accessibility // info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestReloadButtonAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestReloadButtonAccObj) { + // Verify Reload button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_RELOAD_BUTTON), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)), @@ -205,7 +218,10 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestReloadButtonAccObj) { } // Retrieve accessibility object for Home button and verify accessibility info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestHomeButtonAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestHomeButtonAccObj) { + // Verify Home button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_HOME_BUTTON), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)), @@ -213,35 +229,31 @@ IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestHomeButtonAccObj) { } // Retrieve accessibility object for Star button and verify accessibility info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestStarButtonAccObj) { - TestViewAccessibilityObject( - GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), - UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_STAR)), - ROLE_SYSTEM_PUSHBUTTON); -} - -// Retrieve accessibility object for Mic search button and verify accessibility -// info. +// http://crbug.com/104132 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, - TestMicSearchButtonViewAccObj) { + DISABLED_TestStarButtonAccObj) { + // Verify Star button MSAA name and role. TestViewAccessibilityObject( - GetToolbarView()->GetViewByID(VIEW_ID_MIC_SEARCH_BUTTON), - UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)), + GetToolbarView()->GetViewByID(VIEW_ID_STAR_BUTTON), + UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)), ROLE_SYSTEM_PUSHBUTTON); } // Retrieve accessibility object for App menu button and verify accessibility // info. -IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, TestAppMenuAccObj) { +// http://crbug.com/104132 +IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, + DISABLED_TestAppMenuAccObj) { + // Verify App menu button MSAA name and role. TestViewAccessibilityObject( GetToolbarView()->GetViewByID(VIEW_ID_APP_MENU), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)), ROLE_SYSTEM_BUTTONMENU); } -// Retrieve accessibility object for bookmark bar and verify accessibility info. +// http://crbug.com/104132 IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest, - TestBookmarkBarViewAccObj) { + DISABLED_TestBookmarkBarViewAccObj) { TestViewAccessibilityObject( GetBookmarkBarView(), UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)), 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 eaa8e7c..1caa380c 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -45,7 +45,6 @@ #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" #include "chrome/browser/ui/views/location_bar/location_icon_view.h" -#include "chrome/browser/ui/views/location_bar/mic_search_view.h" #include "chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h" #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" @@ -181,7 +180,6 @@ LocationBarView::LocationBarView(Browser* browser, selected_keyword_view_(NULL), suggested_text_view_(NULL), keyword_hint_view_(NULL), - mic_search_view_(NULL), zoom_view_(NULL), autofill_credit_card_view_(NULL), open_pdf_in_reader_view_(NULL), @@ -214,16 +212,11 @@ LocationBarView::LocationBarView(Browser* browser, base::Bind(&LocationBarView::Update, base::Unretained(this), static_cast<content::WebContents*>(NULL))); - - if (browser_) - browser_->search_model()->AddObserver(this); } LocationBarView::~LocationBarView() { if (template_url_service_) template_url_service_->RemoveObserver(this); - if (browser_) - browser_->search_model()->RemoveObserver(this); } void LocationBarView::Init() { @@ -311,10 +304,6 @@ void LocationBarView::Init() { background_color); AddChildView(keyword_hint_view_); - mic_search_view_ = new MicSearchView(this); - mic_search_view_->SetVisible(false); - AddChildView(mic_search_view_); - for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { ContentSettingImageView* content_blocked_view = new ContentSettingImageView(static_cast<ContentSettingsType>(i), this, @@ -339,12 +328,17 @@ void LocationBarView::Init() { script_bubble_icon_view_->SetVisible(false); AddChildView(script_bubble_icon_view_); - star_view_ = new StarView(command_updater_); - star_view_->SetVisible(false); - AddChildView(star_view_); - + // The star icon is hidden in popups. + if (browser_defaults::bookmarks_enabled && !is_popup_mode_) { + star_view_ = new StarView(command_updater_); + star_view_->SetVisible(true); + AddChildView(star_view_); + } if (extensions::FeatureSwitch::action_box()->IsEnabled() && !is_popup_mode_ && browser_) { + if (star_view_) + star_view_->SetVisible(false); + action_box_button_view_ = new ActionBoxButtonView( browser_, gfx::Point(GetHorizontalEdgeThickness(), vertical_edge_thickness())); @@ -468,9 +462,6 @@ void LocationBarView::SetAnimationOffset(int offset) { } void LocationBarView::Update(const WebContents* tab_for_state_restoring) { - mic_search_view_->SetVisible( - !model_->GetInputInProgress() && browser_ && - browser_->search_model()->voice_search_supported()); RefreshContentSettingViews(); autofill_credit_card_view_->Update(); ZoomBubbleView::CloseBubble(); @@ -480,9 +471,8 @@ void LocationBarView::Update(const WebContents* tab_for_state_restoring) { open_pdf_in_reader_view_->Update( model_->GetInputInProgress() ? NULL : GetWebContents()); - bool star_enabled = - browser_defaults::bookmarks_enabled && !is_popup_mode_ && star_view_ && - !model_->GetInputInProgress() && edit_bookmarks_enabled_.GetValue(); + bool star_enabled = star_view_ && !model_->GetInputInProgress() && + edit_bookmarks_enabled_.GetValue(); command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled); command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, @@ -588,12 +578,14 @@ views::View* LocationBarView::GetPageActionView(ExtensionAction *page_action) { } void LocationBarView::SetStarToggled(bool on) { - if (!star_view_) - return; - star_view_->SetToggled(on); - if (action_box_button_view_ && (star_view_->visible() != on)) { - star_view_->SetVisible(on); - Layout(); + if (star_view_) + star_view_->SetToggled(on); + + if (action_box_button_view_) { + if (star_view_ && (star_view_->visible() != on)) { + star_view_->SetVisible(on); + Layout(); + } } } @@ -791,10 +783,6 @@ void LocationBarView::Layout() { location_height, 0, autofill_credit_card_view_); } - if (mic_search_view_->visible()) { - trailing_decorations.AddDecoration(vertical_edge_thickness(), - location_height, 0, 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() && is_keyword_hint && @@ -1337,12 +1325,6 @@ void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { popup->UpdatePopupAppearance(); } -void LocationBarView::ButtonPressed(views::Button* sender, - const ui::Event& event) { - DCHECK_EQ(mic_search_view_, sender); - command_updater_->ExecuteCommand(IDC_TOGGLE_SPEECH_INPUT); -} - void LocationBarView::WriteDragDataForView(views::View* sender, const gfx::Point& press_pt, OSExchangeData* data) { @@ -1527,16 +1509,6 @@ void LocationBarView::Observe(int type, } } -void LocationBarView::ModelChanged(const SearchModel::State& old_state, - const SearchModel::State& new_state) { - const bool visible = - !model_->GetInputInProgress() && new_state.voice_search_supported; - if (mic_search_view_->visible() != visible) { - mic_search_view_->SetVisible(visible); - Layout(); - } -} - int LocationBarView::GetInternalHeight(bool use_preferred_size) { int total_height = use_preferred_size ? GetPreferredSize().height() : height(); diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index 2296e8c..93a6fab 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -14,7 +14,6 @@ #include "chrome/browser/search_engines/template_url_service_observer.h" #include "chrome/browser/ui/omnibox/location_bar.h" #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" -#include "chrome/browser/ui/search/search_model_observer.h" #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/browser/ui/views/dropdown_bar_host.h" #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" @@ -23,7 +22,6 @@ #include "content/public/browser/notification_registrar.h" #include "ui/gfx/font.h" #include "ui/gfx/rect.h" -#include "ui/views/controls/button/button.h" #include "ui/views/controls/native/native_view_host.h" #include "ui/views/drag_controller.h" @@ -42,7 +40,6 @@ class GURL; class InstantController; class KeywordHintView; class LocationIconView; -class MicSearchView; class OpenPDFInReaderView; class PageActionWithBadgeView; class PageActionImageView; @@ -70,13 +67,11 @@ class Widget; class LocationBarView : public LocationBar, public LocationBarTesting, public views::View, - public views::ButtonListener, public views::DragController, public OmniboxEditController, public DropdownBarHostDelegate, public TemplateURLServiceObserver, - public content::NotificationObserver, - public SearchModelObserver { + public content::NotificationObserver { public: // The location bar view's class name. static const char kViewClassName[]; @@ -274,10 +269,6 @@ class LocationBarView : public LocationBar, virtual bool HasFocus() const OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; - // views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, - const ui::Event& event) OVERRIDE; - // views::DragController: virtual void WriteDragDataForView(View* sender, const gfx::Point& press_pt, @@ -324,10 +315,6 @@ class LocationBarView : public LocationBar, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // SearchModelObserver: - virtual void ModelChanged(const SearchModel::State& old_state, - const SearchModel::State& new_state) OVERRIDE; - // Returns the height of the control without the top and bottom // edges(i.e. the height of the edit control inside). If // |use_preferred_size| is true this will be the preferred height, @@ -478,9 +465,6 @@ class LocationBarView : public LocationBar, // Shown if the selected url has a corresponding keyword. KeywordHintView* keyword_hint_view_; - // The voice search icon. - MicSearchView* mic_search_view_; - // The content setting views. ContentSettingViews content_setting_views_; diff --git a/chrome/browser/ui/views/location_bar/mic_search_view.cc b/chrome/browser/ui/views/location_bar/mic_search_view.cc deleted file mode 100644 index 31f67d6..0000000 --- a/chrome/browser/ui/views/location_bar/mic_search_view.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/location_bar/mic_search_view.h" - -#include "chrome/browser/ui/view_ids.h" -#include "grit/generated_resources.h" -#include "grit/theme_resources.h" -#include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" - -MicSearchView::MicSearchView(views::ButtonListener* button_listener) - : views::ImageButton(button_listener) { - set_id(VIEW_ID_MIC_SEARCH_BUTTON); - set_accessibility_focusable(true); - SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_MIC_SEARCH)); - SetImage(STATE_NORMAL, - ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_OMNIBOX_MIC_SEARCH)); - SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE); - TouchableLocationBarView::Init(this); -} - -MicSearchView::~MicSearchView() { -} - -int MicSearchView::GetBuiltInHorizontalPadding() const { - return GetBuiltInHorizontalPaddingImpl(); -} diff --git a/chrome/browser/ui/views/location_bar/mic_search_view.h b/chrome/browser/ui/views/location_bar/mic_search_view.h deleted file mode 100644 index 30159a7..0000000 --- a/chrome/browser/ui/views/location_bar/mic_search_view.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_MIC_SEARCH_VIEW_H_ -#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_MIC_SEARCH_VIEW_H_ - -#include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" -#include "ui/views/controls/button/image_button.h" - -class CommandUpdater; - -class MicSearchView : public views::ImageButton, - public TouchableLocationBarView { - public: - explicit MicSearchView(views::ButtonListener* button_listener); - virtual ~MicSearchView(); - - // TouchableLocationBarView: - virtual int GetBuiltInHorizontalPadding() const OVERRIDE; - - private: - DISALLOW_COPY_AND_ASSIGN(MicSearchView); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_MIC_SEARCH_VIEW_H_ diff --git a/chrome/browser/ui/views/location_bar/script_bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/script_bubble_icon_view.cc index 75cbe3b..0420b9c 100644 --- a/chrome/browser/ui/views/location_bar/script_bubble_icon_view.cc +++ b/chrome/browser/ui/views/location_bar/script_bubble_icon_view.cc @@ -61,6 +61,7 @@ void ScriptBubbleIconView::Layout() { } void ScriptBubbleIconView::GetAccessibleState(ui::AccessibleViewState* state) { + state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_STAR); state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; } diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc index 1d020aa..d732432 100644 --- a/chrome/browser/ui/views/location_bar/star_view.cc +++ b/chrome/browser/ui/views/location_bar/star_view.cc @@ -30,10 +30,6 @@ StarView::StarView(CommandUpdater* command_updater) StarView::~StarView() { } -int StarView::GetBuiltInHorizontalPadding() const { - return GetBuiltInHorizontalPaddingImpl(); -} - void StarView::SetToggled(bool on) { SetTooltipText(l10n_util::GetStringUTF16( on ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR)); @@ -41,7 +37,12 @@ void StarView::SetToggled(bool on) { on ? IDR_STAR_LIT : IDR_STAR)); } +int StarView::GetBuiltInHorizontalPadding() const { + return GetBuiltInHorizontalPaddingImpl(); +} + void StarView::GetAccessibleState(ui::AccessibleViewState* state) { + state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_STAR); state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; } diff --git a/chrome/browser/ui/views/location_bar/star_view.h b/chrome/browser/ui/views/location_bar/star_view.h index bac32f0..6035d4c 100644 --- a/chrome/browser/ui/views/location_bar/star_view.h +++ b/chrome/browser/ui/views/location_bar/star_view.h @@ -10,19 +10,20 @@ class CommandUpdater; -class StarView : public views::ImageView, public TouchableLocationBarView { +class StarView : public views::ImageView, + public TouchableLocationBarView { public: explicit StarView(CommandUpdater* command_updater); virtual ~StarView(); - // TouchableLocationBarView: - virtual int GetBuiltInHorizontalPadding() const OVERRIDE; - // Toggles the star on or off. void SetToggled(bool on); + // TouchableLocationBarView. + virtual int GetBuiltInHorizontalPadding() const OVERRIDE; + private: - // views::ImageView: + // views::ImageView overrides: virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) const OVERRIDE; @@ -41,7 +42,7 @@ class StarView : public views::ImageView, public TouchableLocationBarView { // prevent the bubble from reshowing. bool suppress_mouse_released_action_; - DISALLOW_COPY_AND_ASSIGN(StarView); + DISALLOW_IMPLICIT_CONSTRUCTORS(StarView); }; #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 3da4c3e..305e34e 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -1799,8 +1799,6 @@ 'browser/ui/views/location_bar/location_bar_view.h', 'browser/ui/views/location_bar/location_icon_view.cc', 'browser/ui/views/location_bar/location_icon_view.h', - 'browser/ui/views/location_bar/mic_search_view.cc', - 'browser/ui/views/location_bar/mic_search_view.h', 'browser/ui/views/location_bar/open_pdf_in_reader_view.cc', 'browser/ui/views/location_bar/open_pdf_in_reader_view.h', 'browser/ui/views/location_bar/page_action_image_view.cc', |