OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013 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_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_ | |
6 #define ASH_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "ash/common/login_status.h" | |
10 #include "ash/resources/vector_icons/vector_icons.h" | |
11 #include "base/macros.h" | |
12 #include "ui/gfx/geometry/size.h" | |
13 #include "ui/views/view.h" | |
14 | |
15 namespace ash { | |
16 class ViewClickListener; | |
17 | |
18 // Not used in material design. This class represents the bottom row of | |
19 // detailed views and the bottom row of the system menu (date, help, power, | |
20 // and lock). This row has a fixed height. | |
21 // TODO(tdanderson): Remove this class when material design is enabled by | |
22 // default. See crbug.com/614453. | |
23 class ASH_EXPORT SpecialPopupRow : public views::View { | |
24 public: | |
25 SpecialPopupRow(); | |
26 ~SpecialPopupRow() override; | |
27 | |
28 // Creates a text label corresponding to |string_id| and sets it as the | |
29 // content of this row. | |
30 void SetTextLabel(int string_id, ViewClickListener* listener); | |
31 | |
32 // Sets |content_| to be |view| and adds |content_| as a child view of this | |
33 // row. This should only be called once, upon initialization of the row. | |
34 void SetContent(views::View* view); | |
35 | |
36 // Adds |view| after this row's content. | |
37 void AddViewToTitleRow(views::View* view); | |
38 | |
39 // Adds |view| after this row's content, optionally with a separator. Only | |
40 // used for non-MD. | |
41 void AddViewToRowNonMd(views::View* view, bool add_separator); | |
42 | |
43 views::View* content() const { return content_; } | |
44 | |
45 private: | |
46 // views::View: | |
47 gfx::Size GetPreferredSize() const override; | |
48 int GetHeightForWidth(int width) const override; | |
49 void Layout() override; | |
50 | |
51 // Used to add views to |views_after_content_container_|, respectively. Views | |
52 // are added in a left-to-right order. | |
53 void AddViewAfterContent(views::View* view); | |
54 void AddViewAfterContent(views::View* view, bool add_separator); | |
55 | |
56 // The main content of this row, typically a label. | |
57 views::View* content_; | |
58 | |
59 // The container for the views positioned after |content_|. | |
60 views::View* views_after_content_container_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow); | |
63 }; | |
64 | |
65 } // namespace ash | |
66 | |
67 #endif // ASH_COMMON_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_ | |
OLD | NEW |