| 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_TRAY_TRAY_DETAILS_VIEW_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 6 #define ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/system/tray/special_popup_row.h" | 9 #include "ash/system/tray/special_popup_row.h" |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 class ScrollView; | 13 class ScrollView; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 class FixedSizedScrollView; | 17 class FixedSizedScrollView; |
| 18 class ScrollBorder; | 18 class ScrollBorder; |
| 19 class SystemTrayItem; | 19 class SystemTrayItem; |
| 20 class ViewClickListener; | 20 class ViewClickListener; |
| 21 | 21 |
| 22 class ASH_EXPORT TrayDetailsView : public views::View { | 22 class ASH_EXPORT TrayDetailsView : public views::View { |
| 23 public: | 23 public: |
| 24 explicit TrayDetailsView(SystemTrayItem* owner); | 24 explicit TrayDetailsView(SystemTrayItem* owner); |
| 25 virtual ~TrayDetailsView(); | 25 ~TrayDetailsView() override; |
| 26 | 26 |
| 27 // Creates a row with special highlighting etc. This is typically the | 27 // Creates a row with special highlighting etc. This is typically the |
| 28 // bottom-most row in the popup. | 28 // bottom-most row in the popup. |
| 29 void CreateSpecialRow(int string_id, ViewClickListener* listener); | 29 void CreateSpecialRow(int string_id, ViewClickListener* listener); |
| 30 | 30 |
| 31 // Creates a scrollable list. The list has a border at the bottom if there is | 31 // Creates a scrollable list. The list has a border at the bottom if there is |
| 32 // any other view between the list and the footer row at the bottom. | 32 // any other view between the list and the footer row at the bottom. |
| 33 void CreateScrollableList(); | 33 void CreateScrollableList(); |
| 34 | 34 |
| 35 // Adds a separator in scrollable list. | 35 // Adds a separator in scrollable list. |
| 36 void AddScrollSeparator(); | 36 void AddScrollSeparator(); |
| 37 | 37 |
| 38 // Removes (and destroys) all child views. | 38 // Removes (and destroys) all child views. |
| 39 void Reset(); | 39 void Reset(); |
| 40 | 40 |
| 41 // Transition to default view from details view. If |footer_| has focus before | 41 // Transition to default view from details view. If |footer_| has focus before |
| 42 // transition, the default view should focus on the owner of this details | 42 // transition, the default view should focus on the owner of this details |
| 43 // view. | 43 // view. |
| 44 void TransitionToDefaultView(); | 44 void TransitionToDefaultView(); |
| 45 | 45 |
| 46 SystemTrayItem* owner() const { return owner_; } | 46 SystemTrayItem* owner() const { return owner_; } |
| 47 SpecialPopupRow* footer() const { return footer_; } | 47 SpecialPopupRow* footer() const { return footer_; } |
| 48 FixedSizedScrollView* scroller() const { return scroller_; } | 48 FixedSizedScrollView* scroller() const { return scroller_; } |
| 49 views::View* scroll_content() const { return scroll_content_; } | 49 views::View* scroll_content() const { return scroll_content_; } |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // Overridden from views::View. | 52 // Overridden from views::View. |
| 53 virtual void Layout() override; | 53 void Layout() override; |
| 54 virtual void OnPaintBorder(gfx::Canvas* canvas) override; | 54 void OnPaintBorder(gfx::Canvas* canvas) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 SystemTrayItem* owner_; | 57 SystemTrayItem* owner_; |
| 58 SpecialPopupRow* footer_; | 58 SpecialPopupRow* footer_; |
| 59 FixedSizedScrollView* scroller_; | 59 FixedSizedScrollView* scroller_; |
| 60 views::View* scroll_content_; | 60 views::View* scroll_content_; |
| 61 ScrollBorder* scroll_border_; // Weak reference | 61 ScrollBorder* scroll_border_; // Weak reference |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); | 63 DISALLOW_COPY_AND_ASSIGN(TrayDetailsView); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace ash | 66 } // namespace ash |
| 67 | 67 |
| 68 #endif // ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ | 68 #endif // ASH_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_ |
| OLD | NEW |