summaryrefslogtreecommitdiffstats
path: root/ash/system/tray/special_popup_row.h
blob: f287f3d5f7af0503b42b30641fdaa0fa0f56d134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_
#define ASH_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_

#include "ash/ash_export.h"
#include "ui/gfx/size.h"
#include "ui/views/view.h"

namespace views {
class Label;
}

namespace ash {
class ThrobberView;
class TrayItemView;
class TrayPopupHeaderButton;
class ViewClickListener;

// The 'special' looking row in the uber-tray popups. This is usually the bottom
// row in the popups, and has a fixed height.
class ASH_EXPORT SpecialPopupRow : public views::View {
 public:
  SpecialPopupRow();
  ~SpecialPopupRow() override;

  void SetTextLabel(int string_id, ViewClickListener* listener);
  void SetContent(views::View* view);

  void AddButton(TrayPopupHeaderButton* button);
  void AddThrobber(ThrobberView* throbber);

  views::View* content() const { return content_; }

 private:
  // Overridden from views::View.
  gfx::Size GetPreferredSize() const override;
  int GetHeightForWidth(int width) const override;
  void Layout() override;

  views::View* content_;
  views::View* button_container_;
  views::Label* text_label_;

  DISALLOW_COPY_AND_ASSIGN(SpecialPopupRow);
};

}  // namespace ash

#endif  // ASH_SYSTEM_TRAY_SPECIAL_POPUP_ROW_H_