OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/common/shelf/shelf_types.h" | 9 #include "ash/common/shelf/shelf_types.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 void AddTray(views::View* tray); | 26 void AddTray(views::View* tray); |
27 | 27 |
28 // Called whenever layout might change (e.g. alignment changed). | 28 // Called whenever layout might change (e.g. alignment changed). |
29 void UpdateLayout(); | 29 void UpdateLayout(); |
30 | 30 |
31 // Sets the focus cycler. | 31 // Sets the focus cycler. |
32 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); | 32 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); |
33 | 33 |
34 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } | 34 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } |
35 | 35 |
| 36 void set_custom_focus_traversable( |
| 37 views::FocusTraversable* custom_focus_traversable) { |
| 38 custom_focus_traversable_ = custom_focus_traversable; |
| 39 } |
| 40 |
| 41 void set_default_last_focusable_child(bool default_last_focusable_child) { |
| 42 default_last_focusable_child_ = default_last_focusable_child; |
| 43 } |
| 44 |
36 // Overridden from views::AccessiblePaneView. | 45 // Overridden from views::AccessiblePaneView. |
37 View* GetDefaultFocusableChild() override; | 46 View* GetDefaultFocusableChild() override; |
| 47 views::FocusSearch* GetFocusSearch() override; |
| 48 views::FocusTraversable* GetFocusTraversableParent() override; |
| 49 views::View* GetFocusTraversableParentView() override; |
38 | 50 |
39 // Overridden from views::View: | 51 // Overridden from views::View: |
40 views::Widget* GetWidget() override; | 52 views::Widget* GetWidget() override; |
41 const views::Widget* GetWidget() const override; | 53 const views::Widget* GetWidget() const override; |
42 | 54 |
43 // Overridden from ui::EventHandler: | 55 // Overridden from ui::EventHandler: |
44 void OnGestureEvent(ui::GestureEvent* event) override; | 56 void OnGestureEvent(ui::GestureEvent* event) override; |
45 | 57 |
46 // views::WidgetDelegate overrides: | 58 // views::WidgetDelegate overrides: |
47 bool CanActivate() const override; | 59 bool CanActivate() const override; |
48 void DeleteDelegate() override; | 60 void DeleteDelegate() override; |
49 | 61 |
50 protected: | 62 protected: |
51 // Overridden from views::View: | 63 // Overridden from views::View: |
52 void ChildPreferredSizeChanged(views::View* child) override; | 64 void ChildPreferredSizeChanged(views::View* child) override; |
53 void ChildVisibilityChanged(views::View* child) override; | 65 void ChildVisibilityChanged(views::View* child) override; |
54 | 66 |
55 private: | 67 private: |
56 void UpdateWidgetSize(); | 68 void UpdateWidgetSize(); |
57 | 69 |
58 // Sets a border on |child|. If |extend_border_to_edge| is true, then an extra | 70 // Sets a border on |child|. If |extend_border_to_edge| is true, then an extra |
59 // wide border is added to extend the view's hit region to the edge of the | 71 // wide border is added to extend the view's hit region to the edge of the |
60 // screen. | 72 // screen. |
61 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); | 73 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); |
62 | 74 |
| 75 views::FocusTraversable* custom_focus_traversable_ = nullptr; |
| 76 |
| 77 // When true, the default focus of the status area widget is the last |
| 78 // focusable child. |
| 79 bool default_last_focusable_child_ = false; |
| 80 |
63 const FocusCycler* focus_cycler_for_testing_; | 81 const FocusCycler* focus_cycler_for_testing_; |
64 | 82 |
65 // TODO(jamescook): Get this from WmShelf. | 83 // TODO(jamescook): Get this from WmShelf. |
66 ShelfAlignment alignment_; | 84 ShelfAlignment alignment_; |
67 | 85 |
68 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); | 86 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); |
69 }; | 87 }; |
70 | 88 |
71 } // namespace ash | 89 } // namespace ash |
72 | 90 |
73 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 91 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
OLD | NEW |