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