| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/task.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "views/focus/focus_manager.h" | 12 #include "views/focus/focus_manager.h" |
| 13 #include "views/view.h" | 13 #include "views/view.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class FocusSearch; | 16 class FocusSearch; |
| 17 } | 17 } |
| 18 | 18 |
| 19 // This class provides keyboard access to any view that extends it, typically | 19 // This class provides keyboard access to any view that extends it, typically |
| 20 // a toolbar. The user sets focus to a control in this view by pressing | 20 // a toolbar. The user sets focus to a control in this view by pressing |
| 21 // F6 to traverse all panes, or by pressing a shortcut that jumps directly | 21 // F6 to traverse all panes, or by pressing a shortcut that jumps directly |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Select all text in the location bar | 67 // Select all text in the location bar |
| 68 virtual void LocationBarSelectAll(); | 68 virtual void LocationBarSelectAll(); |
| 69 | 69 |
| 70 void RestoreLastFocusedView(); | 70 void RestoreLastFocusedView(); |
| 71 | 71 |
| 72 View* GetFirstFocusableChild(); | 72 View* GetFirstFocusableChild(); |
| 73 View* GetLastFocusableChild(); | 73 View* GetLastFocusableChild(); |
| 74 | 74 |
| 75 bool pane_has_focus_; | 75 bool pane_has_focus_; |
| 76 | 76 |
| 77 ScopedRunnableMethodFactory<AccessiblePaneView> method_factory_; | 77 base::WeakPtrFactory<AccessiblePaneView> method_factory_; |
| 78 | 78 |
| 79 // Save the focus manager rather than calling GetFocusManager(), | 79 // Save the focus manager rather than calling GetFocusManager(), |
| 80 // so that we can remove focus listeners in the destructor. | 80 // so that we can remove focus listeners in the destructor. |
| 81 views::FocusManager* focus_manager_; | 81 views::FocusManager* focus_manager_; |
| 82 | 82 |
| 83 // Our custom focus search implementation that traps focus in this | 83 // Our custom focus search implementation that traps focus in this |
| 84 // pane and traverses all views that are focusable for accessibility, | 84 // pane and traverses all views that are focusable for accessibility, |
| 85 // not just those that are normally focusable. | 85 // not just those that are normally focusable. |
| 86 scoped_ptr<views::FocusSearch> focus_search_; | 86 scoped_ptr<views::FocusSearch> focus_search_; |
| 87 | 87 |
| 88 // Registered accelerators | 88 // Registered accelerators |
| 89 views::Accelerator home_key_; | 89 views::Accelerator home_key_; |
| 90 views::Accelerator end_key_; | 90 views::Accelerator end_key_; |
| 91 views::Accelerator escape_key_; | 91 views::Accelerator escape_key_; |
| 92 views::Accelerator left_key_; | 92 views::Accelerator left_key_; |
| 93 views::Accelerator right_key_; | 93 views::Accelerator right_key_; |
| 94 | 94 |
| 95 // Last focused view that issued this traversal. | 95 // Last focused view that issued this traversal. |
| 96 int last_focused_view_storage_id_; | 96 int last_focused_view_storage_id_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); | 98 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 101 #endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
| OLD | NEW |