| 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_H_ | 5 #ifndef ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
| 6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_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 "ash/wm/shelf_auto_hide_behavior.h" |
| 11 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 |
| 15 class ShellDelegate; |
| 16 class SystemTray; |
| 17 class SystemTrayDelegate; |
| 18 |
| 14 namespace internal { | 19 namespace internal { |
| 15 | 20 |
| 16 class StatusAreaWidgetDelegate; | 21 class StatusAreaWidgetDelegate; |
| 17 | 22 |
| 18 class ASH_EXPORT StatusAreaWidget : public views::Widget { | 23 class ASH_EXPORT StatusAreaWidget : public views::Widget { |
| 19 public: | 24 public: |
| 20 StatusAreaWidget(); | 25 StatusAreaWidget(); |
| 21 virtual ~StatusAreaWidget(); | 26 virtual ~StatusAreaWidget(); |
| 22 | 27 |
| 23 void AddTray(views::View* tray); | 28 // Creates the SystemTray. |
| 29 void CreateTrayViews(ShellDelegate* shell_delegate); |
| 30 |
| 31 // Destroys the system tray. Called before tearing down the windows to avoid |
| 32 // shutdown ordering issues. |
| 33 void Shutdown(); |
| 34 |
| 24 void SetShelfAlignment(ShelfAlignment alignment); | 35 void SetShelfAlignment(ShelfAlignment alignment); |
| 25 | 36 |
| 37 SystemTray* system_tray() { return system_tray_; } |
| 38 SystemTrayDelegate* system_tray_delegate() { |
| 39 return system_tray_delegate_.get(); |
| 40 } |
| 41 |
| 26 private: | 42 private: |
| 43 void AddSystemTray(SystemTray* system_tray, ShellDelegate* shell_delegate); |
| 44 |
| 45 scoped_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 46 // Weak pointers to View classes that are parented to StatusAreaWidget: |
| 27 internal::StatusAreaWidgetDelegate* widget_delegate_; | 47 internal::StatusAreaWidgetDelegate* widget_delegate_; |
| 48 SystemTray* system_tray_; |
| 28 | 49 |
| 29 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 50 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
| 30 }; | 51 }; |
| 31 | 52 |
| 32 } // namespace internal | 53 } // namespace internal |
| 33 } // namespace ash | 54 } // namespace ash |
| 34 | 55 |
| 35 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 56 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
| OLD | NEW |