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_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void Init(Profile* profile); | 53 void Init(Profile* profile); |
54 | 54 |
55 // views::View | 55 // views::View |
56 virtual void Layout(); | 56 virtual void Layout(); |
57 virtual void Paint(ChromeCanvas* canvas); | 57 virtual void Paint(ChromeCanvas* canvas); |
58 virtual void DidGainFocus(); | 58 virtual void DidGainFocus(); |
59 virtual void WillLoseFocus(); | 59 virtual void WillLoseFocus(); |
60 virtual bool OnKeyPressed(const views::KeyEvent& e); | 60 virtual bool OnKeyPressed(const views::KeyEvent& e); |
61 virtual bool OnKeyReleased(const views::KeyEvent& e); | 61 virtual bool OnKeyReleased(const views::KeyEvent& e); |
62 virtual gfx::Size GetPreferredSize(); | 62 virtual gfx::Size GetPreferredSize(); |
| 63 virtual bool GetAccessibleName(std::wstring* name); |
| 64 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 65 virtual void SetAccessibleName(const std::wstring& name); |
63 | 66 |
64 // Overridden from EncodingMenuControllerDelegate: | 67 // Overridden from EncodingMenuControllerDelegate: |
65 virtual bool IsItemChecked(int id) const; | 68 virtual bool IsItemChecked(int id) const; |
66 | 69 |
67 // Overridden from Menu::BaseControllerDelegate: | 70 // Overridden from Menu::BaseControllerDelegate: |
68 virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); | 71 virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); |
69 | 72 |
70 // views::MenuDelegate | 73 // views::MenuDelegate |
71 virtual void RunMenu(views::View* source, const CPoint& pt, HWND hwnd); | 74 virtual void RunMenu(views::View* source, const CPoint& pt, HWND hwnd); |
72 | 75 |
(...skipping 11 matching lines...) Expand all Loading... |
84 LocationBarView* GetLocationBarView() const { return location_bar_; } | 87 LocationBarView* GetLocationBarView() const { return location_bar_; } |
85 | 88 |
86 // Updates the toolbar (and transitively the location bar) with the states of | 89 // Updates the toolbar (and transitively the location bar) with the states of |
87 // the specified |tab|. If |should_restore_state| is true, we're switching | 90 // the specified |tab|. If |should_restore_state| is true, we're switching |
88 // (back?) to this tab and should restore any previous location bar state | 91 // (back?) to this tab and should restore any previous location bar state |
89 // (such as user editing) as well. | 92 // (such as user editing) as well. |
90 void Update(TabContents* tab, bool should_restore_state); | 93 void Update(TabContents* tab, bool should_restore_state); |
91 | 94 |
92 virtual void OnInputInProgress(bool in_progress); | 95 virtual void OnInputInProgress(bool in_progress); |
93 | 96 |
94 // Returns a brief, identifying string, containing a unique, readable name. | |
95 virtual bool GetAccessibleName(std::wstring* name); | |
96 | |
97 // Returns the MSAA role of the current view. The role is what assistive | |
98 // technologies (ATs) use to determine what behavior to expect from a given | |
99 // control. | |
100 virtual bool GetAccessibleRole(VARIANT* role); | |
101 | |
102 // Assigns an accessible string name. | |
103 virtual void SetAccessibleName(const std::wstring& name); | |
104 | |
105 virtual View* GetAccFocusedChildView() { return acc_focused_view_; } | 97 virtual View* GetAccFocusedChildView() { return acc_focused_view_; } |
106 | 98 |
107 // Returns the index of the next view of the toolbar, starting from the given | 99 // Returns the index of the next view of the toolbar, starting from the given |
108 // view index (skipping the location bar), in the given navigation direction | 100 // view index (skipping the location bar), in the given navigation direction |
109 // (nav_left true means navigation right to left, and vice versa). -1 finds | 101 // (nav_left true means navigation right to left, and vice versa). -1 finds |
110 // first accessible child, based on the above policy. | 102 // first accessible child, based on the above policy. |
111 int GetNextAccessibleViewIndex(int view_index, bool nav_left); | 103 int GetNextAccessibleViewIndex(int view_index, bool nav_left); |
112 | 104 |
113 void set_acc_focused_view(views::View* acc_focused_view) { | 105 void set_acc_focused_view(views::View* acc_focused_view) { |
114 acc_focused_view_ = acc_focused_view; | 106 acc_focused_view_ = acc_focused_view; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 scoped_refptr<GetProfilesHelper> profiles_helper_; | 204 scoped_refptr<GetProfilesHelper> profiles_helper_; |
213 | 205 |
214 // Controls whether or not a home button should be shown on the toolbar. | 206 // Controls whether or not a home button should be shown on the toolbar. |
215 BooleanPrefMember show_home_button_; | 207 BooleanPrefMember show_home_button_; |
216 | 208 |
217 // The display mode used when laying out the toolbar. | 209 // The display mode used when laying out the toolbar. |
218 DisplayMode display_mode_; | 210 DisplayMode display_mode_; |
219 }; | 211 }; |
220 | 212 |
221 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 213 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
OLD | NEW |