Add toplevel trace event to MessagePumpLibevent::OnLibeventNotification
[chromium-blink-merge.git] / ash / system / status_area_widget_delegate.h
blob62dee2c7c4d37d964206dc81d9a3acbd87933b2c
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"
15 namespace ash {
16 class FocusCycler;
18 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView,
19 public views::WidgetDelegate {
20 public:
21 StatusAreaWidgetDelegate();
22 ~StatusAreaWidgetDelegate() override;
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).
28 void UpdateLayout();
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 View* GetDefaultFocusableChild() override;
38 // Overridden from views::View:
39 views::Widget* GetWidget() override;
40 const views::Widget* GetWidget() const override;
42 // Overridden from ui::EventHandler:
43 void OnGestureEvent(ui::GestureEvent* event) override;
45 // views::WidgetDelegate overrides:
46 bool CanActivate() const override;
47 void DeleteDelegate() override;
49 protected:
50 // Overridden from views::View:
51 void ChildPreferredSizeChanged(views::View* child) override;
52 void ChildVisibilityChanged(views::View* child) override;
54 private:
55 void UpdateWidgetSize();
57 const FocusCycler* focus_cycler_for_testing_;
58 ShelfAlignment alignment_;
60 ShelfGestureHandler gesture_handler_;
62 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate);
65 } // namespace ash
67 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_