diff options
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 28 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.h | 9 | ||||
-rw-r--r-- | chrome/browser/views/detachable_toolbar_view.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 20 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 7 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 249 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.h | 39 | ||||
-rwxr-xr-x | chrome/chrome.gyp | 4 | ||||
-rw-r--r-- | views/controls/button/menu_button.cc | 7 | ||||
-rw-r--r-- | views/controls/button/menu_button.h | 8 |
10 files changed, 61 insertions, 314 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index a8876de..40a8f26 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -39,7 +39,6 @@ #include "grit/theme_resources.h" #include "views/controls/button/menu_button.h" #include "views/controls/label.h" -#include "views/controls/button/menu_button.h" #include "views/controls/menu/menu_item_view.h" #include "views/drag_utils.h" #include "views/view_constants.h" @@ -693,25 +692,8 @@ int BookmarkBarView::OnPerformDrop(const DropTargetEvent& event) { index); } -bool BookmarkBarView::GetAccessibleName(std::wstring* name) { - DCHECK(name); - - if (!accessible_name_.empty()) { - name->assign(accessible_name_); - return true; - } - return false; -} - -bool BookmarkBarView::GetAccessibleRole(AccessibilityTypes::Role* role) { - DCHECK(role); - - *role = AccessibilityTypes::ROLE_TOOLBAR; - return true; -} - -void BookmarkBarView::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); +bool BookmarkBarView::IsAccessibleViewTraversable(views::View* view) {
+ return view != bookmarks_separator_view_ && view != instructions_;
} void BookmarkBarView::OnStateChanged() { @@ -871,15 +853,15 @@ void BookmarkBarView::Init() { if (!kDefaultFavIcon) kDefaultFavIcon = rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); - other_bookmarked_button_ = CreateOtherBookmarkedButton(); - AddChildView(other_bookmarked_button_); - sync_error_button_ = CreateSyncErrorButton(); AddChildView(sync_error_button_); overflow_button_ = CreateOverflowButton(); AddChildView(overflow_button_); + other_bookmarked_button_ = CreateOtherBookmarkedButton(); + AddChildView(other_bookmarked_button_); + bookmarks_separator_view_ = new ButtonSeparatorView(); bookmarks_separator_view_->SetAccessibleName( l10n_util::GetString(IDS_ACCNAME_SEPARATOR)); diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index 49ac37f..cc2631a 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -112,9 +112,9 @@ class BookmarkBarView : public DetachableToolbarView, virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); virtual int OnPerformDrop(const views::DropTargetEvent& event); - virtual bool GetAccessibleName(std::wstring* name); - virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - virtual void SetAccessibleName(const std::wstring& name); + + // AccessibleToolbarView methods: + virtual bool IsAccessibleViewTraversable(views::View* view); // ProfileSyncServiceObserver method. virtual void OnStateChanged(); @@ -485,9 +485,6 @@ class BookmarkBarView : public DetachableToolbarView, // Background for extension toolstrips. SkBitmap toolstrip_background_; - // Storage of strings needed for accessibility. - std::wstring accessible_name_; - DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); }; diff --git a/chrome/browser/views/detachable_toolbar_view.h b/chrome/browser/views/detachable_toolbar_view.h index 875ad98..d27ee53 100644 --- a/chrome/browser/views/detachable_toolbar_view.h +++ b/chrome/browser/views/detachable_toolbar_view.h @@ -5,14 +5,14 @@ #ifndef CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ #define CHROME_BROWSER_VIEWS_DETACHABLE_TOOLBAR_VIEW_H_ -#include "views/view.h" +#include "chrome/browser/views/accessible_toolbar_view.h" class SkBitmap; struct SkRect; // DetachableToolbarView contains functionality common to views that can detach // from the Chrome frame, such as the BookmarkBarView and the Extension shelf. -class DetachableToolbarView : public views::View { +class DetachableToolbarView : public AccessibleToolbarView { public: // The color gradient start value close to the edge of the divider. static const SkColor kEdgeDividerColor; diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index dd241d1..e71acc5 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -125,7 +125,7 @@ static const int kNewtabBarRoundness = 5; // ------------ // Returned from BrowserView::GetClassName. -static const char kBrowserViewClassName[] = "browser/views/BrowserView"; +const char BrowserView::kViewClassName[] = "browser/views/BrowserView"; /////////////////////////////////////////////////////////////////////////////// // BookmarkExtensionBackground, private: @@ -657,6 +657,17 @@ void BrowserView::PrepareToRunSystemMenu(HMENU menu) { } #endif +void BrowserView::TraverseNextAccessibleToolbar(bool forward) { + // TODO(mohamed) This needs to be smart, that applies to all toolbars. + // Currently it just traverses between bookmarks and toolbar. + if (forward && toolbar_->IsVisible() && toolbar_->IsEnabled()) { + toolbar_->RequestFocus(); + } else if (!forward && bookmark_bar_view_->IsVisible() && + bookmark_bar_view_->IsEnabled()) { + bookmark_bar_view_->RequestFocus(); + } +} + // static void BrowserView::RegisterBrowserViewPrefs(PrefService* prefs) { prefs->RegisterIntegerPref(prefs::kPluginMessageResponseTimeout, @@ -959,7 +970,7 @@ void BrowserView::UpdateToolbar(TabContents* contents, } void BrowserView::FocusToolbar() { - toolbar_->InitializeTraversal(); + toolbar_->RequestFocus(); } void BrowserView::DestroyBrowser() { @@ -1554,7 +1565,6 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) { // Determine if the TabStrip exists and is capable of being clicked on. We // might be a popup window without a TabStrip. if (IsTabStripVisible()) { - // See if the mouse pointer is within the bounds of the TabStrip. gfx::Point point_in_tabstrip_coords(point); View::ConvertPointToView(GetParent(), tabstrip_->GetView(), @@ -1642,7 +1652,7 @@ gfx::Size BrowserView::GetMinimumSize() { // BrowserView, views::View overrides: std::string BrowserView::GetClassName() const { - return kBrowserViewClassName; + return kViewClassName; } void BrowserView::Layout() { @@ -2076,7 +2086,7 @@ bool BrowserView::UpdateChildViewAndLayout(views::View* new_view, new_view->SetBounds((*old_view)->bounds()); new_view->SchedulePaint(); } else if (new_view) { - DCHECK(new_height == 0); + DCHECK_EQ(new_height, 0); // The heights are the same, but the old view is null. This only happens // when the height is zero. Zero out the bounds. new_view->SetBounds(0, 0, 0, 0); diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index cf4ca78..7778017 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -71,6 +71,9 @@ class BrowserView : public BrowserWindow, public views::WindowDelegate, public views::ClientView { public: + // The browser view's class name. + static const char kViewClassName[]; + // Explicitly sets how windows are shown. Use a value of -1 to give the // default behavior. This is used during testing and not generally useful // otherwise. @@ -181,6 +184,10 @@ class BrowserView : public BrowserWindow, void PrepareToRunSystemMenu(HMENU menu); #endif + // Traverses to the next toolbar. |forward| when true, will navigate from left + // to right and vice versa when false. + void TraverseNextAccessibleToolbar(bool forward); + // Returns true if the Browser object associated with this BrowserView is a // normal-type window (i.e. a browser window, not an app or popup). bool IsBrowserTypeNormal() const { diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 0747331..20346c2 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -51,9 +51,6 @@ #include "views/controls/button/button_dropdown.h" #include "views/controls/label.h" #include "views/drag_utils.h" -#include "views/focus/view_storage.h" -#include "views/widget/root_view.h" -#include "views/widget/tooltip_manager.h" #include "views/window/non_client_view.h" #include "views/window/window.h" @@ -153,9 +150,6 @@ void ZoomMenuModel::Build() { ToolbarView::ToolbarView(Browser* browser) : model_(browser->toolbar_model()), - acc_focused_view_(NULL), - last_focused_view_storage_id_( - views::ViewStorage::GetSharedInstance()->CreateStorageID()), back_(NULL), forward_(NULL), reload_(NULL), @@ -224,48 +218,11 @@ void ToolbarView::Update(TabContents* tab, bool should_restore_state) { browser_actions_->RefreshBrowserActionViews(); } -int ToolbarView::GetNextAccessibleViewIndex(int view_index, bool nav_left) { - int modifier = 1; - - if (nav_left) - modifier = -1; - - int current_view_index = view_index + modifier; - - while ((current_view_index >= 0) && - (current_view_index < GetChildViewCount())) { - // Skip the location bar, as it has its own keyboard navigation. Also skip - // any views that cannot be interacted with. - if (current_view_index == GetChildIndex(location_bar_) || - !GetChildViewAt(current_view_index)->IsEnabled() || - !GetChildViewAt(current_view_index)->IsVisible()) { - current_view_index += modifier; - continue; - } - // Update view_index with the available button index found. - view_index = current_view_index; - break; - } - // Returns the next available button index, or if no button is available in - // the specified direction, remains where it was. - return view_index; -} - -void ToolbarView::InitializeTraversal() { - // If MSAA focus exists, we don't need to traverse, since its already active. - if (acc_focused_view_ != NULL) - return; - - // Save the last focused view so that when the user presses ESC, it will - // return back to the last focus. - views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); - view_storage->StoreView(last_focused_view_storage_id_, - GetRootView()->GetFocusedView()); +//////////////////////////////////////////////////////////////////////////////// +// ToolbarView, AccessibleToolbarView overrides: - // HACK: Do not use RequestFocus() here, as the toolbar is not marked as - // "focusable". Instead bypass the sanity check in RequestFocus() and just - // force it to focus, which will do the right thing. - GetRootView()->FocusView(this); +bool ToolbarView::IsAccessibleViewTraversable(views::View* view) { + return view != location_bar_; } //////////////////////////////////////////////////////////////////////////////// @@ -629,204 +586,6 @@ void ToolbarView::ThemeChanged() { LoadRightSideControlsImages(); } -void ToolbarView::ShowContextMenu(int x, int y, bool is_mouse_gesture) { - if (acc_focused_view_) - acc_focused_view_->ShowContextMenu(x, y, is_mouse_gesture); -} - -void ToolbarView::DidGainFocus() { - // Check to see if MSAA focus should be restored to previously focused button, - // and if button is an enabled, visibled child of toolbar. - if (!acc_focused_view_ || - (acc_focused_view_->GetParent()->GetID() != VIEW_ID_TOOLBAR) || - !acc_focused_view_->IsEnabled() || - !acc_focused_view_->IsVisible()) { - // Find first accessible child (-1 to start search at parent). - int first_acc_child = GetNextAccessibleViewIndex(-1, false); - - // No buttons enabled or visible. - if (first_acc_child == -1) - return; - - set_acc_focused_view(GetChildViewAt(first_acc_child)); - } - - // Default focus is on the toolbar. - int view_index = VIEW_ID_TOOLBAR; - - // Set hot-tracking for child, and update focused_view for MSAA focus event. - if (acc_focused_view_) { - acc_focused_view_->SetHotTracked(true); - - // Show the tooltip for the view that got the focus. - if (GetWidget()->GetTooltipManager()) - GetWidget()->GetTooltipManager()->ShowKeyboardTooltip(acc_focused_view_); - - // Update focused_view with MSAA-adjusted child id. - view_index = acc_focused_view_->GetID(); - } - -#if defined(OS_WIN) - gfx::NativeView wnd = GetWidget()->GetNativeView(); - - // Notify Access Technology that there was a change in keyboard focus. - ::NotifyWinEvent(EVENT_OBJECT_FOCUS, wnd, OBJID_CLIENT, - static_cast<LONG>(view_index)); -#else - // TODO(port): deal with toolbar a11y focus. - NOTIMPLEMENTED(); -#endif -} - -void ToolbarView::WillLoseFocus() { - // Any tooltips that are active should be hidden when toolbar loses focus. - if (GetWidget() && GetWidget()->GetTooltipManager()) - GetWidget()->GetTooltipManager()->HideKeyboardTooltip(); - - // Removes the Child MSAA view's focus and the view from the ViewStorage, - // when toolbar loses focus. - if (acc_focused_view_) { - acc_focused_view_->SetHotTracked(false); - acc_focused_view_ = NULL; - views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); - view_storage->RemoveView(last_focused_view_storage_id_); - } -} - -void ToolbarView::RequestFocus() { - // When the toolbar needs to request focus, the default implementation of - // View::RequestFocus requires the View to be focusable. Since ToolbarView is - // not technically focused, we need to temporarily set and remove focus so - // that it can focus back to its MSAA focused state. |acc_focused_view_| is - // not necessarily set since it can be null if this view has already lost - // focus, such as traversing through the context menu. - SetFocusable(true); - View::RequestFocus(); - SetFocusable(false); -} - -bool ToolbarView::OnKeyPressed(const views::KeyEvent& e) { - // Paranoia check, button should be initialized upon toolbar gaining focus. - if (!acc_focused_view_) - return false; - - int focused_view = GetChildIndex(acc_focused_view_); - int next_view = focused_view; - - switch (e.GetKeyCode()) { - case base::VKEY_LEFT: - next_view = GetNextAccessibleViewIndex(focused_view, true); - break; - case base::VKEY_RIGHT: - next_view = GetNextAccessibleViewIndex(focused_view, false); - break; - case base::VKEY_DOWN: - case base::VKEY_RETURN: - // VKEY_SPACE is already handled by the default case. - if (acc_focused_view_->GetID() == VIEW_ID_PAGE_MENU || - acc_focused_view_->GetID() == VIEW_ID_APP_MENU) { - // If a menu button in toolbar is activated and its menu is displayed, - // then active tooltip should be hidden. - if (GetWidget()->GetTooltipManager()) - GetWidget()->GetTooltipManager()->HideKeyboardTooltip(); - // Safe to cast, given to above view id check. - static_cast<views::MenuButton*>(acc_focused_view_)->Activate(); - if (!acc_focused_view_) { - // Activate triggered a focus change, don't try to change focus. - return true; - } - // Re-enable hot-tracking, as Activate() will disable it. - acc_focused_view_->SetHotTracked(true); - break; - } - default: - // If key is not handled explicitly, pass it on to view. - return acc_focused_view_->OnKeyPressed(e); - } - - // No buttons enabled or visible. - if (next_view == -1) - return false; - - // Only send an event if focus moved. - if (next_view != focused_view) { - // Remove hot-tracking from old focused button. - acc_focused_view_->SetHotTracked(false); - - // All is well, update the focused child member variable. - acc_focused_view_ = GetChildViewAt(next_view); - - // Hot-track new focused button. - acc_focused_view_->SetHotTracked(true); - - // Show the tooltip for the view that got the focus. - if (GetWidget()->GetTooltipManager()) { - GetWidget()->GetTooltipManager()-> - ShowKeyboardTooltip(GetChildViewAt(next_view)); - } -#if defined(OS_WIN) - // Retrieve information to generate an MSAA focus event. - gfx::NativeView wnd = GetWidget()->GetNativeView(); - int view_id = acc_focused_view_->GetID(); - // Notify Access Technology that there was a change in keyboard focus. - ::NotifyWinEvent(EVENT_OBJECT_FOCUS, wnd, OBJID_CLIENT, - static_cast<LONG>(view_id)); -#else - NOTIMPLEMENTED(); -#endif - return true; - } - return false; -} - -bool ToolbarView::OnKeyReleased(const views::KeyEvent& e) { - // Paranoia check, button should be initialized upon toolbar gaining focus. - if (!acc_focused_view_) - return false; - - // Have keys be handled by the views themselves. - return acc_focused_view_->OnKeyReleased(e); -} - -bool ToolbarView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { - if (acc_focused_view_ && e.GetKeyCode() == base::VKEY_ESCAPE) { - // Retrieve the focused view from the storage so we can request focus back - // to it. If |focus_view| is null, we place focus on the location bar. - // |acc_focused_view_| doesn't need to be resetted here since it will be - // dealt within the WillLoseFocus method. - views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); - views::View* focused_view = - view_storage->RetrieveView(last_focused_view_storage_id_); - if (focused_view) { - view_storage->RemoveView(last_focused_view_storage_id_); - focused_view->RequestFocus(); - } else { - location_bar_->RequestFocus(); - } - return true; - } - return false; -} - -bool ToolbarView::GetAccessibleName(std::wstring* name) { - if (!accessible_name_.empty()) { - (*name).assign(accessible_name_); - return true; - } - return false; -} - -bool ToolbarView::GetAccessibleRole(AccessibilityTypes::Role* role) { - DCHECK(role); - - *role = AccessibilityTypes::ROLE_TOOLBAR; - return true; -} - -void ToolbarView::SetAccessibleName(const std::wstring& name) { - accessible_name_.assign(name); -} - //////////////////////////////////////////////////////////////////////////////// // ToolbarView, views::DragController implementation: diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index 94b54e4..cfca8b4 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -12,6 +12,7 @@ #include "chrome/browser/bubble_positioner.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/user_data_manager.h" +#include "chrome/browser/views/accessible_toolbar_view.h" #include "chrome/browser/views/go_button.h" #include "chrome/browser/views/location_bar_view.h" #include "chrome/common/pref_member.h" @@ -63,8 +64,8 @@ class ZoomMenuModel : public views::SimpleMenuModel { DISALLOW_COPY_AND_ASSIGN(ZoomMenuModel); }; -// The Browser Window's toolbar. Used within BrowserView. -class ToolbarView : public views::View, +// The Browser Window's toolbar. +class ToolbarView : public AccessibleToolbarView, public views::ViewMenuDelegate, public views::DragController, public views::SimpleMenuModel::Delegate, @@ -91,19 +92,6 @@ class ToolbarView : public views::View, // (such as user editing) as well. void Update(TabContents* tab, bool should_restore_state); - // Returns the index of the next view of the toolbar, starting from the given - // view index (skipping the location bar), in the given navigation direction - // (nav_left true means navigation right to left, and vice versa). -1 finds - // first accessible child, based on the above policy. - int GetNextAccessibleViewIndex(int view_index, bool nav_left); - - // Initialize the MSAA focus traversal on the toolbar. - void InitializeTraversal(); - - void set_acc_focused_view(views::View* acc_focused_view) { - acc_focused_view_ = acc_focused_view; - } - // Accessors... Browser* browser() const { return browser_; } BrowserActionsContainer* browser_actions() const { return browser_actions_; } @@ -113,6 +101,9 @@ class ToolbarView : public views::View, views::MenuButton* page_menu() const { return page_menu_; } views::MenuButton* app_menu() const { return app_menu_; } + // Overridden from AccessibleToolbarView: + virtual bool IsAccessibleViewTraversable(views::View* view); + // Overridden from Menu::BaseControllerDelegate: virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); @@ -152,17 +143,6 @@ class ToolbarView : public views::View, virtual void Layout(); virtual void Paint(gfx::Canvas* canvas); virtual void ThemeChanged(); - virtual void ShowContextMenu(int x, int y, bool is_mouse_gesture); - virtual void DidGainFocus(); - virtual void WillLoseFocus(); - virtual void RequestFocus(); - virtual bool OnKeyPressed(const views::KeyEvent& e); - virtual bool OnKeyReleased(const views::KeyEvent& e); - 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); - virtual View* GetAccFocusedChildView() { return acc_focused_view_; } private: // Overridden from views::DragController: @@ -211,13 +191,6 @@ class ToolbarView : public views::View, // The model that contains the security level, text, icon to display... ToolbarModel* model_; - // Storage of strings needed for accessibility. - std::wstring accessible_name_; - // Child view currently having MSAA focus (location bar excluded from arrow - // navigation). - views::View* acc_focused_view_; - int last_focused_view_storage_id_; - // Controls views::ImageButton* back_; views::ImageButton* forward_; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index e35bf5e..9c4ec31 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -2244,6 +2244,8 @@ 'browser/views/about_network_dialog.h', 'browser/views/accelerator_table_gtk.cc', 'browser/views/accelerator_table_gtk.h', + 'browser/views/accessible_toolbar_view.cc', + 'browser/views/accessible_toolbar_view.h', 'browser/views/autocomplete/autocomplete_popup_contents_view.cc', 'browser/views/autocomplete/autocomplete_popup_contents_view.h', 'browser/views/autocomplete/autocomplete_popup_win.cc', @@ -2802,6 +2804,8 @@ ['include', '^browser/extensions/'], ['include', '^browser/views/accelerator_table_gtk.cc'], ['include', '^browser/views/accelerator_table_gtk.h'], + ['include', '^browser/views/accessible_toolbar_view.cc'], + ['include', '^browser/views/accessible_toolbar_view.h'], ['include', '^browser/views/autocomplete/autocomplete_popup_contents_view.cc'], ['include', '^browser/views/autocomplete/autocomplete_popup_contents_view.h'], ['include', '^browser/views/autocomplete/autocomplete_popup_gtk.cc'], diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index 7fb81cb..eb9d952 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -35,6 +35,9 @@ static const SkBitmap* kMenuMarker = NULL; static const int kMenuMarkerPaddingLeft = 3; static const int kMenuMarkerPaddingRight = -1; +// static +const char MenuButton::kViewClassName[] = "views/MenuButton"; + //////////////////////////////////////////////////////////////////////////////// // // MenuButton - constructors, destructors, initialization @@ -252,4 +255,8 @@ bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) { return true; } +std::string MenuButton::GetClassName() const { + return kViewClassName; +} + } // namespace views diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h index 1f5f8e8..44a93c6 100644 --- a/views/controls/button/menu_button.h +++ b/views/controls/button/menu_button.h @@ -5,6 +5,8 @@ #ifndef VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ #define VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ +#include <string> + #include "app/gfx/font.h" #include "base/time.h" #include "views/background.h" @@ -25,6 +27,9 @@ class ViewMenuDelegate; //////////////////////////////////////////////////////////////////////////////// class MenuButton : public TextButton { public: + // The menu button's class name. + static const char kViewClassName[]; + // // Create a Button MenuButton(ButtonListener* listener, @@ -56,6 +61,9 @@ class MenuButton : public TextButton { virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); virtual bool GetAccessibleState(AccessibilityTypes::State* state); + // Returns views/MenuButton. + virtual std::string GetClassName() const; + protected: // True if the menu is currently visible. bool menu_visible_; |