diff options
39 files changed, 32 insertions, 310 deletions
diff --git a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc b/chrome/browser/chromeos/frame/normal_browser_frame_view.cc index c84e2bd..7b80753 100644 --- a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc +++ b/chrome/browser/chromeos/frame/normal_browser_frame_view.cc @@ -213,20 +213,6 @@ bool NormalBrowserFrameView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool NormalBrowserFrameView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void NormalBrowserFrameView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - /////////////////////////////////////////////////////////////////////////////// // NormalBrowserFrameView, TabIconView::TabContentsProvider implementation: diff --git a/chrome/browser/chromeos/frame/normal_browser_frame_view.h b/chrome/browser/chromeos/frame/normal_browser_frame_view.h index a26c2a7..e0d55ab 100644 --- a/chrome/browser/chromeos/frame/normal_browser_frame_view.h +++ b/chrome/browser/chromeos/frame/normal_browser_frame_view.h @@ -56,8 +56,6 @@ class NormalBrowserFrameView : public BrowserNonClientFrameView, views::View* parent, views::View* child); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); // Overridden from TabIconView::TabIconViewModel: virtual bool ShouldTabIconViewAnimate() const; diff --git a/chrome/browser/views/accessible_toolbar_view.cc b/chrome/browser/views/accessible_toolbar_view.cc index d85648d0..a7e8f1b 100644 --- a/chrome/browser/views/accessible_toolbar_view.cc +++ b/chrome/browser/views/accessible_toolbar_view.cc @@ -204,11 +204,6 @@ bool AccessibleToolbarView::SkipDefaultKeyEventProcessing( } } -bool AccessibleToolbarView::GetAccessibleName(std::wstring* name) { - *name = accessible_name_; - return !accessible_name_.empty(); -} - bool AccessibleToolbarView::GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -216,10 +211,6 @@ bool AccessibleToolbarView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -void AccessibleToolbarView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - void AccessibleToolbarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { // When the toolbar is removed, traverse to the next accessible toolbar. diff --git a/chrome/browser/views/accessible_toolbar_view.h b/chrome/browser/views/accessible_toolbar_view.h index f2ef13f..c129f4b 100644 --- a/chrome/browser/views/accessible_toolbar_view.h +++ b/chrome/browser/views/accessible_toolbar_view.h @@ -29,9 +29,7 @@ class AccessibleToolbarView : public views::View { virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture); virtual void RequestFocus(); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); virtual View* GetAccFocusedChildView() { return selected_focused_view_; } diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index a887487..a1cecbf 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -342,16 +342,6 @@ class BookmarkBarView::ButtonSeparatorView : public views::View { return gfx::Size(kSeparatorWidth, 1); } - virtual bool GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; - } - virtual bool GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -359,10 +349,6 @@ class BookmarkBarView::ButtonSeparatorView : public views::View { return true; } - virtual void SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); - } - private: // Storage of strings needed for accessibility. std::wstring accessible_name_; diff --git a/chrome/browser/views/extensions/extension_shelf.cc b/chrome/browser/views/extensions/extension_shelf.cc index 4a3c333..571e21d 100644 --- a/chrome/browser/views/extensions/extension_shelf.cc +++ b/chrome/browser/views/extensions/extension_shelf.cc @@ -779,20 +779,6 @@ bool ExtensionShelf::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool ExtensionShelf::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; -} - -void ExtensionShelf::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - void ExtensionShelf::ThemeChanged() { // Refresh the CSS to update toolstrip text colors from theme. int count = model_->count(); diff --git a/chrome/browser/views/extensions/extension_shelf.h b/chrome/browser/views/extensions/extension_shelf.h index af6abe2..df8a0ec 100644 --- a/chrome/browser/views/extensions/extension_shelf.h +++ b/chrome/browser/views/extensions/extension_shelf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -50,9 +50,7 @@ class ExtensionShelf : public DetachableToolbarView, virtual void Layout(); virtual void OnMouseExited(const views::MouseEvent& event); virtual void OnMouseEntered(const views::MouseEvent& event); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); virtual void ThemeChanged(); // ExtensionContainer methods: diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 93ab8f4..b8cdb89 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1608,20 +1608,6 @@ bool BrowserView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool BrowserView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void BrowserView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - void BrowserView::InfoBarSizeChanged(bool is_animating) { SelectedTabToolbarSizeChanged(is_animating); } diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index f5b4c40..1e01f28 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -384,8 +384,6 @@ class BrowserView : public BrowserBubbleHost, views::View* child); virtual void ChildPreferredSizeChanged(View* child); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); // Factory Methods. // Returns a new LayoutManager for this browser view. A subclass may diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 532b559..e9276f8 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -378,20 +378,6 @@ bool OpaqueBrowserFrameView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool OpaqueBrowserFrameView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void OpaqueBrowserFrameView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - /////////////////////////////////////////////////////////////////////////////// // OpaqueBrowserFrameView, views::ButtonListener implementation: diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index 57e9def..59c322c 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -52,8 +52,6 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, virtual void Layout(); virtual bool HitTest(const gfx::Point& l) const; virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); // Overridden from views::ButtonListener: virtual void ButtonPressed(views::Button* sender, const views::Event& event); diff --git a/chrome/browser/views/infobars/infobar_container.cc b/chrome/browser/views/infobars/infobar_container.cc index c140a4b..4301132 100644 --- a/chrome/browser/views/infobars/infobar_container.cc +++ b/chrome/browser/views/infobars/infobar_container.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -78,16 +78,6 @@ void InfoBarContainer::Layout() { } } -bool InfoBarContainer::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; -} - bool InfoBarContainer::GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -95,10 +85,6 @@ bool InfoBarContainer::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -void InfoBarContainer::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - void InfoBarContainer::ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child) { diff --git a/chrome/browser/views/infobars/infobar_container.h b/chrome/browser/views/infobars/infobar_container.h index c71f5b9..f9bb85a 100644 --- a/chrome/browser/views/infobars/infobar_container.h +++ b/chrome/browser/views/infobars/infobar_container.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -44,9 +44,7 @@ class InfoBarContainer : public views::View, // Overridden from views::View: virtual gfx::Size GetPreferredSize(); virtual void Layout(); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); protected: virtual void ViewHierarchyChanged(bool is_add, diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index f99501d..f4e84af 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -178,11 +178,6 @@ void InfoBar::Close() { // InfoBar, views::View overrides: --------------------------------------------- -bool InfoBar::GetAccessibleName(std::wstring* name) { - *name = accessible_name_; - return !accessible_name_.empty(); -} - bool InfoBar::GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -190,10 +185,6 @@ bool InfoBar::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -void InfoBar::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - gfx::Size InfoBar::GetPreferredSize() { int height = static_cast<int>(target_height_ * animation_->GetCurrentValue()); return gfx::Size(0, height); diff --git a/chrome/browser/views/infobars/infobars.h b/chrome/browser/views/infobars/infobars.h index 56cf48f..4fa9efa 100644 --- a/chrome/browser/views/infobars/infobars.h +++ b/chrome/browser/views/infobars/infobars.h @@ -78,9 +78,7 @@ class InfoBar : public views::View, static const int kButtonInLabelSpacing; // Overridden from views::View: - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); virtual gfx::Size GetPreferredSize(); virtual void Layout(); diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 19eb974..a31e604 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -830,16 +830,6 @@ void LocationBarView::ShowFirstRunBubbleInternal(bool use_OEM_bubble) { #endif } -bool LocationBarView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; -} - bool LocationBarView::GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -847,10 +837,6 @@ bool LocationBarView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -void LocationBarView::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - // LocationIconView------------------------------------------------------------- LocationBarView::LocationIconView::LocationIconView( diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index 750983c..8ba1226 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -153,9 +153,7 @@ class LocationBarView : public LocationBar, // Overridden from views::View: virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); // Overridden from LocationBar: virtual void ShowFirstRunBubble(bool use_OEM_bubble); diff --git a/chrome/browser/views/tab_contents/tab_contents_container.cc b/chrome/browser/views/tab_contents/tab_contents_container.cc index f865e5e..fcffce2 100644 --- a/chrome/browser/views/tab_contents/tab_contents_container.cc +++ b/chrome/browser/views/tab_contents/tab_contents_container.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -82,20 +82,6 @@ bool TabContentsContainer::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool TabContentsContainer::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; -} - -void TabContentsContainer::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - void TabContentsContainer::ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child) { diff --git a/chrome/browser/views/tab_contents/tab_contents_container.h b/chrome/browser/views/tab_contents/tab_contents_container.h index 3f60eec..39f2de6 100644 --- a/chrome/browser/views/tab_contents/tab_contents_container.h +++ b/chrome/browser/views/tab_contents/tab_contents_container.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -41,9 +41,7 @@ class TabContentsContainer : public views::View, // Overridden from views::View: virtual void Layout(); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); protected: // Overridden from views::View: diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 9ace17d..1a9edb3 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -1072,18 +1072,6 @@ bool TabStrip::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool TabStrip::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - (*name).assign(accessible_name_); - return true; - } - return false; -} - -void TabStrip::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - views::View* TabStrip::GetViewForPoint(const gfx::Point& point) { // Return any view that isn't a Tab or this TabStrip immediately. We don't // want to interfere. diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index 73e89c8..af6cc34 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -100,8 +100,6 @@ class TabStrip : public BaseTabStrip, virtual void OnDragExited(); virtual int OnPerformDrop(const views::DropTargetEvent& event); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); virtual views::View* GetViewForPoint(const gfx::Point& point); virtual void ThemeChanged(); diff --git a/views/controls/button/button.cc b/views/controls/button/button.cc index 1183951..0305451 100644 --- a/views/controls/button/button.cc +++ b/views/controls/button/button.cc @@ -17,6 +17,10 @@ void Button::SetTooltipText(const std::wstring& tooltip_text) { TooltipTextChanged(); } +void Button::SetAccessibleKeyboardShortcut(const std::wstring& shortcut) { + accessible_shortcut_.assign(shortcut); +} + //////////////////////////////////////////////////////////////////////////////// // Button, View overrides: @@ -36,27 +40,11 @@ bool Button::GetAccessibleKeyboardShortcut(std::wstring* shortcut) { return false; } -bool Button::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - bool Button::GetAccessibleRole(AccessibilityTypes::Role* role) { *role = AccessibilityTypes::ROLE_PUSHBUTTON; return true; } -void Button::SetAccessibleKeyboardShortcut(const std::wstring& shortcut) { - accessible_shortcut_.assign(shortcut); -} - -void Button::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - //////////////////////////////////////////////////////////////////////////////// // Button, protected: diff --git a/views/controls/button/button.h b/views/controls/button/button.h index f9f6e5d..016fd74 100644 --- a/views/controls/button/button.h +++ b/views/controls/button/button.h @@ -32,13 +32,12 @@ class Button : public View { int mouse_event_flags() const { return mouse_event_flags_; } + void SetAccessibleKeyboardShortcut(const std::wstring& shortcut); + // Overridden from View: virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); virtual bool GetAccessibleKeyboardShortcut(std::wstring* shortcut); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleKeyboardShortcut(const std::wstring& shortcut); - virtual void SetAccessibleName(const std::wstring& name); protected: // Construct the Button with a Listener. The listener can be NULL. This can be diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc index 70ba1cc..594dbf3 100644 --- a/views/controls/combobox/combobox.cc +++ b/views/controls/combobox/combobox.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -85,16 +85,6 @@ void Combobox::PaintFocusBorder(gfx::Canvas* canvas) { View::PaintFocusBorder(canvas); } -bool Combobox::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - bool Combobox::GetAccessibleRole(AccessibilityTypes::Role* role) { DCHECK(role); @@ -102,10 +92,6 @@ bool Combobox::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -void Combobox::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - bool Combobox::GetAccessibleValue(std::wstring* value) { DCHECK(value); diff --git a/views/controls/combobox/combobox.h b/views/controls/combobox/combobox.h index b2a8388..ccb9ea6 100644 --- a/views/controls/combobox/combobox.h +++ b/views/controls/combobox/combobox.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -57,9 +57,7 @@ class Combobox : public View { virtual void SetEnabled(bool enabled); virtual bool SkipDefaultKeyEventProcessing(const KeyEvent& e); virtual void PaintFocusBorder(gfx::Canvas* canvas); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); virtual bool GetAccessibleValue(std::wstring* value); protected: diff --git a/views/controls/progress_bar.cc b/views/controls/progress_bar.cc index 4c0cb33..de9cd59 100644 --- a/views/controls/progress_bar.cc +++ b/views/controls/progress_bar.cc @@ -193,18 +193,6 @@ bool ProgressBar::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool ProgressBar::GetAccessibleName(std::wstring* name) { - DCHECK(name); - if (name == NULL) - return false; - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - bool ProgressBar::GetAccessibleState(AccessibilityTypes::State* state) { DCHECK(state); if (state == NULL) @@ -213,8 +201,4 @@ bool ProgressBar::GetAccessibleState(AccessibilityTypes::State* state) { return true; } -void ProgressBar::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - } // namespace views diff --git a/views/controls/progress_bar.h b/views/controls/progress_bar.h index 1047da3..345db81 100644 --- a/views/controls/progress_bar.h +++ b/views/controls/progress_bar.h @@ -58,9 +58,7 @@ class ProgressBar : public View { // Accessibility accessors, overridden from View. virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleState(AccessibilityTypes::State* state); - virtual void SetAccessibleName(const std::wstring& name); // Maximum value of progress. static const int kMaxProgress; diff --git a/views/controls/resize_gripper.cc b/views/controls/resize_gripper.cc index b4fd55f..1a49957 100644 --- a/views/controls/resize_gripper.cc +++ b/views/controls/resize_gripper.cc @@ -82,19 +82,6 @@ bool ResizeGripper::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool ResizeGripper::GetAccessibleName(std::wstring* name) { - DCHECK(name); - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void ResizeGripper::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - void ResizeGripper::ReportResizeAmount(int resize_amount, bool last_update) { gfx::Point point(resize_amount, 0); View::ConvertPointToScreen(this, &point); diff --git a/views/controls/resize_gripper.h b/views/controls/resize_gripper.h index 8586a22..8b46a629 100644 --- a/views/controls/resize_gripper.h +++ b/views/controls/resize_gripper.h @@ -45,8 +45,6 @@ class ResizeGripper : public ImageView { virtual bool OnMouseDragged(const views::MouseEvent& event); virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); static const char kViewClassName[]; diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc index 73feef2..f76acb3 100644 --- a/views/controls/single_split_view.cc +++ b/views/controls/single_split_view.cc @@ -99,18 +99,6 @@ bool SingleSplitView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool SingleSplitView::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void SingleSplitView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - gfx::Size SingleSplitView::GetPreferredSize() { int width = 0; int height = 0; diff --git a/views/controls/single_split_view.h b/views/controls/single_split_view.h index 6dc3f91..f11313d 100644 --- a/views/controls/single_split_view.h +++ b/views/controls/single_split_view.h @@ -26,8 +26,6 @@ class SingleSplitView : public views::View { virtual void Layout(); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); // SingleSplitView's preferred size is the sum of the preferred widths // and the max of the heights. diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index 71f66b4..54e34dd 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -260,18 +260,6 @@ bool Textfield::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool Textfield::GetAccessibleName(std::wstring* name) { - DCHECK(name); - if (!name) - return false; - - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - bool Textfield::GetAccessibleState(AccessibilityTypes::State* state) { DCHECK(state); if (!state) @@ -281,10 +269,6 @@ bool Textfield::GetAccessibleState(AccessibilityTypes::State* state) { return true; } -void Textfield::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - bool Textfield::GetAccessibleValue(std::wstring* value) { DCHECK(value); if (!value) diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h index 7b36547..8be768a 100644 --- a/views/controls/textfield/textfield.h +++ b/views/controls/textfield/textfield.h @@ -223,9 +223,7 @@ class Textfield : public View { // Accessibility accessors, overridden from View: virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); virtual bool GetAccessibleState(AccessibilityTypes::State* state); - virtual void SetAccessibleName(const std::wstring& name); virtual bool GetAccessibleValue(std::wstring* value); protected: diff --git a/views/view.cc b/views/view.cc index c5359a7..3bdb2a2 100644 --- a/views/view.cc +++ b/views/view.cc @@ -1123,6 +1123,19 @@ bool View::InDrag() { return root_view ? (root_view->GetDragView() == this) : false; } +bool View::GetAccessibleName(std::wstring* name) { + DCHECK(name); + + if (accessible_name_.empty()) + return false; + *name = accessible_name_; + return true; +} + +void View::SetAccessibleName(const std::wstring& name) { + accessible_name_ = name; +} + // static void View::ConvertPointToView(const View* src, const View* dst, diff --git a/views/view.h b/views/view.h index e2a76ac..d8177aa 100644 --- a/views/view.h +++ b/views/view.h @@ -573,7 +573,7 @@ class View : public AcceleratorTarget { // Returns a brief, identifying string, containing a unique, readable name of // a given control. Sets the input string appropriately, and returns true if // successful. - virtual bool GetAccessibleName(std::wstring* name) { return false; } + bool GetAccessibleName(std::wstring* name); // Returns the accessibility role of the current view. The role is what // assistive technologies (ATs) use to determine what behavior to expect from @@ -593,20 +593,10 @@ class View : public AcceleratorTarget { // appropriately, and returns true if successful. virtual bool GetAccessibleValue(std::wstring* value) { return false; } - // Assigns a keyboard shortcut string description to the given control. Needed - // as a View does not know which shortcut will be associated with it until it - // is created to be a certain type. - virtual void SetAccessibleKeyboardShortcut(const std::wstring& shortcut) {} - // Assigns a string name to the given control. Needed as a View does not know // which name will be associated with it until it is created to be a // certain type. - virtual void SetAccessibleName(const std::wstring& name) {} - - // Assigns a string value to the given control. Needed as a View does not know - // which value will be associated with it until it is created to be a - // certain type. - virtual void SetAccessibleValue(const std::wstring& value) {} + void SetAccessibleName(const std::wstring& name); // Returns an instance of a wrapper class implementing the (platform-specific) // accessibility interface for a given View. If one exists, it will be @@ -1267,6 +1257,9 @@ class View : public AcceleratorTarget { // List of descendants wanting notification when their visible bounds change. scoped_ptr<ViewList> descendants_to_notify_; + // Name for this view, which can be retrieved by accessibility APIs. + std::wstring accessible_name_; + // Next view to be focused when the Tab key is pressed. View* next_focusable_view_; diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index fcfdf4f..179d49d 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -908,18 +908,6 @@ bool RootView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool RootView::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void RootView::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - View* RootView::GetDragView() { return drag_view_; } diff --git a/views/widget/root_view.h b/views/widget/root_view.h index bfc3b2c..2d74b1f 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -177,8 +177,6 @@ class RootView : public View, // Accessibility accessors/mutators, overridden from View. virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); protected: diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc index fcf4353..e2d1a5c 100644 --- a/views/window/non_client_view.cc +++ b/views/window/non_client_view.cc @@ -182,18 +182,6 @@ bool NonClientView::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } -bool NonClientView::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - *name = accessible_name_; - return true; - } - return false; -} - -void NonClientView::SetAccessibleName(const std::wstring& name) { - accessible_name_ = name; -} - //////////////////////////////////////////////////////////////////////////////// // NonClientFrameView, View overrides: diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h index cb94d25..54c04b7 100644 --- a/views/window/non_client_view.h +++ b/views/window/non_client_view.h @@ -209,8 +209,6 @@ class NonClientView : public View { virtual gfx::Size GetMinimumSize(); virtual void Layout(); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual bool GetAccessibleName(std::wstring* name); - virtual void SetAccessibleName(const std::wstring& name); protected: // NonClientView, View overrides: |