Chromium Code Reviews| 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/common/shelf/shelf_types.h" | 9 #include "ash/common/shelf/shelf_types.h" |
| 10 #include "ash/wm/gestures/shelf_gesture_handler.h" | 10 #include "ash/wm/gestures/shelf_gesture_handler.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 13 #include "ui/views/accessible_pane_view.h" | 13 #include "ui/views/accessible_pane_view.h" |
| 14 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
|
tdanderson
2016/06/10 22:54:43
you don't need/want both line 16 and line 20
yiyix
2016/06/13 18:43:55
Done.
| |
| 17 class TrayBackgroundView; | |
| 18 } | |
| 19 | |
| 20 namespace ash { | |
| 17 class FocusCycler; | 21 class FocusCycler; |
| 18 | 22 |
| 19 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView, | 23 class ASH_EXPORT StatusAreaWidgetDelegate : public views::AccessiblePaneView, |
| 20 public views::WidgetDelegate { | 24 public views::WidgetDelegate { |
| 21 public: | 25 public: |
| 22 StatusAreaWidgetDelegate(); | 26 StatusAreaWidgetDelegate(); |
| 23 ~StatusAreaWidgetDelegate() override; | 27 ~StatusAreaWidgetDelegate() override; |
| 24 | 28 |
| 25 // Add a tray view to the widget (e.g. system tray, web notifications). | 29 // Add a tray view to the widget (e.g. system tray, web notifications). |
| 26 void AddTray(views::View* tray); | 30 void AddTray(TrayBackgroundView* tray); |
|
tdanderson
2016/06/10 22:54:43
I was looking over the chat you, me, and Ben had l
yiyix
2016/06/13 18:43:55
I did not really like the casting. I am glad that
| |
| 27 | 31 |
| 28 // Called whenever layout might change (e.g. alignment changed). | 32 // Called whenever layout might change (e.g. alignment changed). |
| 29 void UpdateLayout(); | 33 void UpdateLayout(); |
| 30 | 34 |
| 31 // Sets the focus cycler. | 35 // Sets the focus cycler. |
| 32 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); | 36 void SetFocusCyclerForTesting(const FocusCycler* focus_cycler); |
| 33 | 37 |
| 34 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } | 38 void set_alignment(ShelfAlignment alignment) { alignment_ = alignment; } |
| 35 | 39 |
| 36 // Overridden from views::AccessiblePaneView. | 40 // Overridden from views::AccessiblePaneView. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 48 void DeleteDelegate() override; | 52 void DeleteDelegate() override; |
| 49 | 53 |
| 50 protected: | 54 protected: |
| 51 // Overridden from views::View: | 55 // Overridden from views::View: |
| 52 void ChildPreferredSizeChanged(views::View* child) override; | 56 void ChildPreferredSizeChanged(views::View* child) override; |
| 53 void ChildVisibilityChanged(views::View* child) override; | 57 void ChildVisibilityChanged(views::View* child) override; |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 void UpdateWidgetSize(); | 60 void UpdateWidgetSize(); |
| 57 | 61 |
| 62 // Tray shows on the right most edge requires an extra wide inset, so edge is | |
|
tdanderson
2016/06/10 22:54:43
nit on wording, change to something like: "Sets a
yiyix
2016/06/13 18:43:55
Done.
| |
| 63 // included the hitting area . | |
| 64 void SetBorderOnEdgeTray(views::View* child); | |
| 65 void SetBorderOnNonEdgeTray(views::View* child); | |
|
tdanderson
2016/06/10 22:54:43
Combine into a single function, such as:
void Set
yiyix
2016/06/13 18:43:55
Done.
| |
| 66 | |
| 58 const FocusCycler* focus_cycler_for_testing_; | 67 const FocusCycler* focus_cycler_for_testing_; |
| 59 ShelfAlignment alignment_; | 68 ShelfAlignment alignment_; |
| 60 | 69 |
| 61 ShelfGestureHandler gesture_handler_; | 70 ShelfGestureHandler gesture_handler_; |
| 62 | 71 |
| 63 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidgetDelegate); |
| 64 }; | 73 }; |
| 65 | 74 |
| 66 } // namespace ash | 75 } // namespace ash |
| 67 | 76 |
| 68 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ | 77 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_DELEGATE_H_ |
| OLD | NEW |