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_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 5 #ifndef ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/wm/shelf_auto_hide_behavior.h" |
10 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
11 #include "ui/views/accessible_pane_view.h" | 12 #include "ui/views/accessible_pane_view.h" |
12 #include "ui/views/layout/box_layout.h" | |
13 #include "ui/views/widget/widget_delegate.h" | 13 #include "ui/views/widget/widget_delegate.h" |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 class FocusCycler; | 18 class FocusCycler; |
19 | 19 |
20 class ASH_EXPORT StatusAreaWidgetDelegate : public views::WidgetDelegate, | 20 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView, |
21 public views::AccessiblePaneView { | 21 public views::WidgetDelegate { |
22 public: | 22 public: |
23 StatusAreaWidgetDelegate(); | 23 StatusAreaWidgetDelegate(); |
24 virtual ~StatusAreaWidgetDelegate(); | 24 virtual ~StatusAreaWidgetDelegate(); |
25 | 25 |
26 // Sets the focus cycler. | 26 // Sets the focus cycler. |
27 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); | 27 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); |
28 | 28 |
29 // Overridden from views::AccessiblePaneView. | 29 // Overridden from views::AccessiblePaneView. |
30 virtual View* GetDefaultFocusableChild() OVERRIDE; | 30 virtual View* GetDefaultFocusableChild() OVERRIDE; |
31 | 31 |
32 // Overridden from views::View: | 32 // Overridden from views::View: |
33 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 33 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
34 virtual views::Widget* GetWidget() OVERRIDE; | 34 virtual views::Widget* GetWidget() OVERRIDE; |
35 virtual const views::Widget* GetWidget() const OVERRIDE; | 35 virtual const views::Widget* GetWidget() const OVERRIDE; |
36 | 36 |
37 // views::WidgetDelegate overrides: | 37 // views::WidgetDelegate overrides: |
38 virtual bool CanActivate() const OVERRIDE; | 38 virtual bool CanActivate() const OVERRIDE; |
39 virtual void DeleteDelegate() OVERRIDE; | 39 virtual void DeleteDelegate() OVERRIDE; |
40 | 40 |
41 void SetLayout(views::BoxLayout::Orientation orientation); | 41 void AddTray(views::View* tray); |
| 42 void UpdateLayout(); |
| 43 |
| 44 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } |
| 45 |
| 46 protected: |
| 47 // Overridden from views::View: |
| 48 virtual void ChildPreferredSizeChanged(View* child); |
42 | 49 |
43 private: | 50 private: |
44 const FocusCycler* focus_cycler_for_testing_; | 51 const FocusCycler* focus_cycler_for_testing_; |
| 52 ShelfAlignment alignment_; |
45 | 53 |
46 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); |
47 }; | 55 }; |
48 | 56 |
49 } // namespace internal | 57 } // namespace internal |
50 } // namespace ash | 58 } // namespace ash |
51 | 59 |
52 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 60 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
OLD | NEW |