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