| 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 | 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" |
| 11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 12 #include "ui/views/accessible_pane_view.h" | 12 #include "ui/views/accessible_pane_view.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 class FocusCycler; | 16 class FocusCycler; |
| 17 class WmShelf; | 17 class Shelf; |
| 18 | 18 |
| 19 // The View for the status area widget. | 19 // The View for the status area widget. |
| 20 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView, | 20 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView, |
| 21 public views::WidgetDelegate { | 21 public views::WidgetDelegate { |
| 22 public: | 22 public: |
| 23 explicit StatusAreaWidgetDelegate(WmShelf* wm_shelf); | 23 explicit StatusAreaWidgetDelegate(Shelf* shelf); |
| 24 ~StatusAreaWidgetDelegate() override; | 24 ~StatusAreaWidgetDelegate() override; |
| 25 | 25 |
| 26 // Returns status area widget delegate from primary system tray if exists, | 26 // Returns status area widget delegate from primary system tray if exists, |
| 27 // otherwise nullptr. | 27 // otherwise nullptr. |
| 28 static StatusAreaWidgetDelegate* GetPrimaryInstance(); | 28 static StatusAreaWidgetDelegate* GetPrimaryInstance(); |
| 29 | 29 |
| 30 // Add a tray view to the widget (e.g. system tray, web notifications). | 30 // Add a tray view to the widget (e.g. system tray, web notifications). |
| 31 void AddTray(views::View* tray); | 31 void AddTray(views::View* tray); |
| 32 | 32 |
| 33 // Called whenever layout might change (e.g. alignment changed). | 33 // Called whenever layout might change (e.g. alignment changed). |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void ChildVisibilityChanged(views::View* child) override; | 65 void ChildVisibilityChanged(views::View* child) override; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 void UpdateWidgetSize(); | 68 void UpdateWidgetSize(); |
| 69 | 69 |
| 70 // Sets a border on |child|. If |extend_border_to_edge| is true, then an extra | 70 // 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 | 71 // wide border is added to extend the view's hit region to the edge of the |
| 72 // screen. | 72 // screen. |
| 73 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); | 73 void SetBorderOnChild(views::View* child, bool extend_border_to_edge); |
| 74 | 74 |
| 75 WmShelf* const wm_shelf_; | 75 Shelf* const shelf_; |
| 76 const FocusCycler* focus_cycler_for_testing_; | 76 const FocusCycler* focus_cycler_for_testing_; |
| 77 | 77 |
| 78 // When true, the default focus of the status area widget is the last | 78 // When true, the default focus of the status area widget is the last |
| 79 // focusable child. | 79 // focusable child. |
| 80 bool default_last_focusable_child_ = false; | 80 bool default_last_focusable_child_ = false; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); | 82 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace ash | 85 } // namespace ash |
| 86 | 86 |
| 87 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 87 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
| OLD | NEW |