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 |
36 // Overridden from views::AccessiblePaneView. | 41 // Overridden from views::AccessiblePaneView. |
37 View* GetDefaultFocusableChild() override; | 42 View* GetDefaultFocusableChild() override; |
| 43 views::FocusSearch* GetFocusSearch() override; |
| 44 views::FocusTraversable* GetFocusTraversableParent() override; |
| 45 views::View* GetFocusTraversableParentView() override; |
38 | 46 |
39 // Overridden from views::View: | 47 // Overridden from views::View: |
40 views::Widget* GetWidget() override; | 48 views::Widget* GetWidget() override; |
41 const views::Widget* GetWidget() const override; | 49 const views::Widget* GetWidget() const override; |
42 | 50 |
43 // Overridden from ui::EventHandler: | 51 // Overridden from ui::EventHandler: |
44 void OnGestureEvent(ui::GestureEvent* event) override; | 52 void OnGestureEvent(ui::GestureEvent* event) override; |
45 | 53 |
46 // views::WidgetDelegate overrides: | 54 // views::WidgetDelegate overrides: |
47 bool CanActivate() const override; | 55 bool CanActivate() const override; |
48 void DeleteDelegate() override; | 56 void DeleteDelegate() override; |
49 | 57 |
50 protected: | 58 protected: |
51 // Overridden from views::View: | 59 // Overridden from views::View: |
52 void ChildPreferredSizeChanged(views::View* child) override; | 60 void ChildPreferredSizeChanged(views::View* child) override; |
53 void ChildVisibilityChanged(views::View* child) override; | 61 void ChildVisibilityChanged(views::View* child) override; |
54 | 62 |
55 private: | 63 private: |
56 void UpdateWidgetSize(); | 64 void UpdateWidgetSize(); |
57 | 65 |
58 // Sets a border on |child|. If |extend_border_to_edge| is true, then an extra | 66 // 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 | 67 // wide border is added to extend the view's hit region to the edge of the |
60 // screen. | 68 // screen. |
61 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); | 69 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); |
62 | 70 |
| 71 views::FocusTraversable* custom_focus_traversable_ = nullptr; |
| 72 |
63 const FocusCycler* focus_cycler_for_testing_; | 73 const FocusCycler* focus_cycler_for_testing_; |
64 | 74 |
65 // TODO(jamescook): Get this from WmShelf. | 75 // TODO(jamescook): Get this from WmShelf. |
66 ShelfAlignment alignment_; | 76 ShelfAlignment alignment_; |
67 | 77 |
68 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); | 78 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); |
69 }; | 79 }; |
70 | 80 |
71 } // namespace ash | 81 } // namespace ash |
72 | 82 |
73 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 83 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
OLD | NEW |