| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // (back?) to this tab and should restore any previous location bar state | 90 // (back?) to this tab and should restore any previous location bar state |
| 91 // (such as user editing) as well. | 91 // (such as user editing) as well. |
| 92 void Update(TabContents* tab, bool should_restore_state); | 92 void Update(TabContents* tab, bool should_restore_state); |
| 93 | 93 |
| 94 // Returns the index of the next view of the toolbar, starting from the given | 94 // Returns the index of the next view of the toolbar, starting from the given |
| 95 // view index (skipping the location bar), in the given navigation direction | 95 // view index (skipping the location bar), in the given navigation direction |
| 96 // (nav_left true means navigation right to left, and vice versa). -1 finds | 96 // (nav_left true means navigation right to left, and vice versa). -1 finds |
| 97 // first accessible child, based on the above policy. | 97 // first accessible child, based on the above policy. |
| 98 int GetNextAccessibleViewIndex(int view_index, bool nav_left); | 98 int GetNextAccessibleViewIndex(int view_index, bool nav_left); |
| 99 | 99 |
| 100 // Initialize the MSAA focus traversal on the toolbar. |
| 101 void InitializeTraversal(); |
| 102 |
| 100 void set_acc_focused_view(views::View* acc_focused_view) { | 103 void set_acc_focused_view(views::View* acc_focused_view) { |
| 101 acc_focused_view_ = acc_focused_view; | 104 acc_focused_view_ = acc_focused_view; |
| 102 } | 105 } |
| 103 | 106 |
| 104 // Accessors... | 107 // Accessors... |
| 105 Browser* browser() const { return browser_; } | 108 Browser* browser() const { return browser_; } |
| 106 BrowserActionsContainer* browser_actions() const { return browser_actions_; } | 109 BrowserActionsContainer* browser_actions() const { return browser_actions_; } |
| 107 ToolbarStarToggle* star_button() const { return star_; } | 110 ToolbarStarToggle* star_button() const { return star_; } |
| 108 GoButton* go_button() const { return go_; } | 111 GoButton* go_button() const { return go_; } |
| 109 LocationBarView* location_bar() const { return location_bar_; } | 112 LocationBarView* location_bar() const { return location_bar_; } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual gfx::Size GetPreferredSize(); | 151 virtual gfx::Size GetPreferredSize(); |
| 149 virtual void Layout(); | 152 virtual void Layout(); |
| 150 virtual void Paint(gfx::Canvas* canvas); | 153 virtual void Paint(gfx::Canvas* canvas); |
| 151 virtual void ThemeChanged(); | 154 virtual void ThemeChanged(); |
| 152 virtual void ShowContextMenu(int x, int y, bool is_mouse_gesture); | 155 virtual void ShowContextMenu(int x, int y, bool is_mouse_gesture); |
| 153 virtual void DidGainFocus(); | 156 virtual void DidGainFocus(); |
| 154 virtual void WillLoseFocus(); | 157 virtual void WillLoseFocus(); |
| 155 virtual void RequestFocus(); | 158 virtual void RequestFocus(); |
| 156 virtual bool OnKeyPressed(const views::KeyEvent& e); | 159 virtual bool OnKeyPressed(const views::KeyEvent& e); |
| 157 virtual bool OnKeyReleased(const views::KeyEvent& e); | 160 virtual bool OnKeyReleased(const views::KeyEvent& e); |
| 161 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); |
| 158 virtual bool GetAccessibleName(std::wstring* name); | 162 virtual bool GetAccessibleName(std::wstring* name); |
| 159 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 163 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 160 virtual void SetAccessibleName(const std::wstring& name); | 164 virtual void SetAccessibleName(const std::wstring& name); |
| 161 virtual View* GetAccFocusedChildView() { return acc_focused_view_; } | 165 virtual View* GetAccFocusedChildView() { return acc_focused_view_; } |
| 162 | 166 |
| 163 private: | 167 private: |
| 164 // Overridden from views::DragController: | 168 // Overridden from views::DragController: |
| 165 virtual void WriteDragData(View* sender, | 169 virtual void WriteDragData(View* sender, |
| 166 int press_x, | 170 int press_x, |
| 167 int press_y, | 171 int press_y, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 scoped_ptr<BackForwardMenuModelViews> forward_menu_model_; | 209 scoped_ptr<BackForwardMenuModelViews> forward_menu_model_; |
| 206 | 210 |
| 207 // The model that contains the security level, text, icon to display... | 211 // The model that contains the security level, text, icon to display... |
| 208 ToolbarModel* model_; | 212 ToolbarModel* model_; |
| 209 | 213 |
| 210 // Storage of strings needed for accessibility. | 214 // Storage of strings needed for accessibility. |
| 211 std::wstring accessible_name_; | 215 std::wstring accessible_name_; |
| 212 // Child view currently having MSAA focus (location bar excluded from arrow | 216 // Child view currently having MSAA focus (location bar excluded from arrow |
| 213 // navigation). | 217 // navigation). |
| 214 views::View* acc_focused_view_; | 218 views::View* acc_focused_view_; |
| 219 int last_focused_view_storage_id_; |
| 215 | 220 |
| 216 // Controls | 221 // Controls |
| 217 views::ImageButton* back_; | 222 views::ImageButton* back_; |
| 218 views::ImageButton* forward_; | 223 views::ImageButton* forward_; |
| 219 views::ImageButton* reload_; | 224 views::ImageButton* reload_; |
| 220 views::ImageButton* home_; | 225 views::ImageButton* home_; |
| 221 ToolbarStarToggle* star_; | 226 ToolbarStarToggle* star_; |
| 222 LocationBarView* location_bar_; | 227 LocationBarView* location_bar_; |
| 223 GoButton* go_; | 228 GoButton* go_; |
| 224 BrowserActionsContainer* browser_actions_; | 229 BrowserActionsContainer* browser_actions_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 247 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; | 252 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; |
| 248 scoped_ptr<views::SimpleMenuModel> devtools_menu_contents_; | 253 scoped_ptr<views::SimpleMenuModel> devtools_menu_contents_; |
| 249 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; | 254 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; |
| 250 | 255 |
| 251 // TODO(beng): build these into MenuButton. | 256 // TODO(beng): build these into MenuButton. |
| 252 scoped_ptr<views::Menu2> page_menu_menu_; | 257 scoped_ptr<views::Menu2> page_menu_menu_; |
| 253 scoped_ptr<views::Menu2> app_menu_menu_; | 258 scoped_ptr<views::Menu2> app_menu_menu_; |
| 254 }; | 259 }; |
| 255 | 260 |
| 256 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ | 261 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H_ |
| OLD | NEW |