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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_
6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_
8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_types.h"
10 #include "ash/wm/gestures/shelf_gesture_handler.h"
11 #include "ui/gfx/image/image_skia.h"
12 #include "ui/views/accessible_pane_view.h"
13 #include "ui/views/widget/widget_delegate.h"
18 class ASH_EXPORT StatusAreaWidgetDelegate
: public views::AccessiblePaneView
,
19 public views::WidgetDelegate
{
21 StatusAreaWidgetDelegate();
22 virtual ~StatusAreaWidgetDelegate();
24 // Add a tray view to the widget (e.g. system tray, web notifications).
25 void AddTray(views::View
* tray
);
27 // Called whenever layout might change (e.g. alignment changed).
30 // Sets the focus cycler.
31 void SetFocusCyclerForTesting(const FocusCycler
* focus_cycler
);
33 void set_alignment(ShelfAlignment alignment
) { alignment_
= alignment
; }
35 // Overridden from views::AccessiblePaneView.
36 virtual View
* GetDefaultFocusableChild() OVERRIDE
;
38 // Overridden from views::View:
39 virtual views::Widget
* GetWidget() OVERRIDE
;
40 virtual const views::Widget
* GetWidget() const OVERRIDE
;
42 // Overridden from ui::EventHandler:
43 virtual void OnGestureEvent(ui::GestureEvent
* event
) OVERRIDE
;
45 // views::WidgetDelegate overrides:
46 virtual bool CanActivate() const OVERRIDE
;
47 virtual void DeleteDelegate() OVERRIDE
;
50 // Overridden from views::View:
51 virtual void ChildPreferredSizeChanged(views::View
* child
) OVERRIDE
;
52 virtual void ChildVisibilityChanged(views::View
* child
) OVERRIDE
;
55 void UpdateWidgetSize();
57 const FocusCycler
* focus_cycler_for_testing_
;
58 ShelfAlignment alignment_
;
60 ShelfGestureHandler gesture_handler_
;
62 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate
);
67 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_