| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| 6 #define CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 6 #define CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "chrome/common/gfx/chrome_font.h" | 10 #include "chrome/common/gfx/chrome_font.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 virtual gfx::Size GetPreferredSize(); | 46 virtual gfx::Size GetPreferredSize(); |
| 47 virtual void Paint(ChromeCanvas* canvas, bool for_drag); | 47 virtual void Paint(ChromeCanvas* canvas, bool for_drag); |
| 48 | 48 |
| 49 // These methods are overriden to implement a simple push button | 49 // These methods are overriden to implement a simple push button |
| 50 // behavior | 50 // behavior |
| 51 virtual bool OnMousePressed(const MouseEvent& e); | 51 virtual bool OnMousePressed(const MouseEvent& e); |
| 52 void OnMouseReleased(const MouseEvent& e, bool canceled); | 52 void OnMouseReleased(const MouseEvent& e, bool canceled); |
| 53 virtual bool OnKeyReleased(const KeyEvent& e); | 53 virtual bool OnKeyReleased(const KeyEvent& e); |
| 54 virtual void OnMouseExited(const MouseEvent& event); | 54 virtual void OnMouseExited(const MouseEvent& event); |
| 55 | 55 |
| 56 // Returns the MSAA default action of the current view. The string returned | 56 // Accessibility accessors, overridden from View. |
| 57 // describes the default action that will occur when executing | 57 virtual bool GetAccessibleDefaultAction(std::wstring* action); |
| 58 // IAccessible::DoDefaultAction. | 58 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 59 bool GetAccessibleDefaultAction(std::wstring* action); | 59 virtual bool GetAccessibleState(AccessibilityTypes::State* state); |
| 60 | |
| 61 // Returns the MSAA role of the current view. The role is what assistive | |
| 62 // technologies (ATs) use to determine what behavior to expect from a given | |
| 63 // control. | |
| 64 bool GetAccessibleRole(VARIANT* role); | |
| 65 | |
| 66 // Returns the MSAA state of the current view. Sets the input VARIANT | |
| 67 // appropriately, and returns true if a change was performed successfully. | |
| 68 // Overriden from View. | |
| 69 virtual bool GetAccessibleState(VARIANT* state); | |
| 70 | 60 |
| 71 protected: | 61 protected: |
| 72 // true if the menu is currently visible. | 62 // true if the menu is currently visible. |
| 73 bool menu_visible_; | 63 bool menu_visible_; |
| 74 | 64 |
| 75 private: | 65 private: |
| 76 | 66 |
| 77 // Compute the maximum X coordinate for the current screen. MenuButtons | 67 // Compute the maximum X coordinate for the current screen. MenuButtons |
| 78 // use this to make sure a menu is never shown off screen. | 68 // use this to make sure a menu is never shown off screen. |
| 79 int GetMaximumScreenXCoordinate(); | 69 int GetMaximumScreenXCoordinate(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 93 | 83 |
| 94 // Whether or not we're showing a drop marker. | 84 // Whether or not we're showing a drop marker. |
| 95 bool show_menu_marker_; | 85 bool show_menu_marker_; |
| 96 | 86 |
| 97 friend class TextButtonBackground; | 87 friend class TextButtonBackground; |
| 98 }; | 88 }; |
| 99 | 89 |
| 100 } // namespace views | 90 } // namespace views |
| 101 | 91 |
| 102 #endif // CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 92 #endif // CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| OLD | NEW |