forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification_header_view.h
82 lines (66 loc) · 2.76 KB
/
notification_header_view.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2017 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 UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_
#define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_
#include "base/macros.h"
#include "ui/message_center/message_center_style.h"
#include "ui/views/controls/button/button.h"
namespace views {
class ImageView;
class Label;
}
namespace message_center {
class NotificationControlButtonsView;
class NotificationHeaderView : public views::Button {
public:
NotificationHeaderView(NotificationControlButtonsView* control_buttons_view,
views::ButtonListener* listener);
void SetAppIcon(const gfx::ImageSkia& img);
void SetAppName(const base::string16& name);
void SetProgress(int progress);
void SetOverflowIndicator(int count);
void SetTimestamp(base::Time past);
void SetExpandButtonEnabled(bool enabled);
void SetExpanded(bool expanded);
void SetSettingsButtonEnabled(bool enabled);
void SetCloseButtonEnabled(bool enabled);
void SetControlButtonsVisible(bool visible);
// Set the unified theme color used among the app icon, app name, and expand
// button.
void SetAccentColor(SkColor color);
void ClearAppIcon();
void ClearProgress();
void ClearOverflowIndicator();
void ClearTimestamp();
bool IsExpandButtonEnabled();
// Button override:
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
const override;
void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
views::ImageView* expand_button() { return expand_button_; }
SkColor accent_color_for_testing() { return accent_color_; }
private:
// Update visibility for both |summary_text_view_| and |timestamp_view_|.
void UpdateSummaryTextVisibility();
SkColor accent_color_ = message_center::kNotificationDefaultAccentColor;
views::InkDropContainerView* ink_drop_container_ = nullptr;
views::Label* app_name_view_ = nullptr;
views::Label* summary_text_divider_ = nullptr;
views::Label* summary_text_view_ = nullptr;
views::Label* timestamp_divider_ = nullptr;
views::Label* timestamp_view_ = nullptr;
views::ImageView* app_icon_view_ = nullptr;
views::ImageView* expand_button_ = nullptr;
bool settings_button_enabled_ = false;
bool has_progress_ = false;
bool has_overflow_indicator_ = false;
bool has_timestamp_ = false;
bool is_expanded_ = false;
DISALLOW_COPY_AND_ASSIGN(NotificationHeaderView);
};
} // namespace message_center
#endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_