Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ui/message_center/views/notification_header_view.h

Issue 2945303006: Add percentage of progress in notification header. (Closed)
Patch Set: Resolve review comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/message_center/views/notification_header_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_ 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_
6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_ 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/message_center/views/padded_button.h" 9 #include "ui/message_center/views/padded_button.h"
10 #include "ui/views/controls/button/custom_button.h" 10 #include "ui/views/controls/button/custom_button.h"
11 11
12 namespace views { 12 namespace views {
13 class ImageButton; 13 class ImageButton;
14 class ImageView; 14 class ImageView;
15 class Label; 15 class Label;
16 } 16 }
17 17
18 namespace message_center { 18 namespace message_center {
19 19
20 class NotificationHeaderView : public views::CustomButton { 20 class NotificationHeaderView : public views::CustomButton {
21 public: 21 public:
22 NotificationHeaderView(views::ButtonListener* listener); 22 NotificationHeaderView(views::ButtonListener* listener);
23 void SetAppIcon(const gfx::ImageSkia& img); 23 void SetAppIcon(const gfx::ImageSkia& img);
24 void SetAppName(const base::string16& name); 24 void SetAppName(const base::string16& name);
25 void SetProgress(int progress);
25 void SetExpandButtonEnabled(bool enabled); 26 void SetExpandButtonEnabled(bool enabled);
26 void SetExpanded(bool expanded); 27 void SetExpanded(bool expanded);
27 void SetSettingsButtonEnabled(bool enabled); 28 void SetSettingsButtonEnabled(bool enabled);
28 void SetCloseButtonEnabled(bool enabled); 29 void SetCloseButtonEnabled(bool enabled);
29 void SetControlButtonsVisible(bool visible); 30 void SetControlButtonsVisible(bool visible);
31 void ClearProgress();
30 bool IsExpandButtonEnabled(); 32 bool IsExpandButtonEnabled();
31 bool IsSettingsButtonEnabled(); 33 bool IsSettingsButtonEnabled();
32 bool IsCloseButtonEnabled(); 34 bool IsCloseButtonEnabled();
33 bool IsCloseButtonFocused(); 35 bool IsCloseButtonFocused();
34 36
35 views::ImageButton* expand_button() { return expand_button_; } 37 views::ImageButton* expand_button() { return expand_button_; }
36 views::ImageButton* settings_button() { return settings_button_; } 38 views::ImageButton* settings_button() { return settings_button_; }
37 views::ImageButton* close_button() { return close_button_; } 39 views::ImageButton* close_button() { return close_button_; }
38 40
39 private: 41 private:
40 void UpdateControlButtonsVisibility(); 42 void UpdateControlButtonsVisibility();
43 void UpdateSummaryTextVisibility();
41 44
42 views::Label* app_name_view_ = nullptr; 45 views::Label* app_name_view_ = nullptr;
46 views::Label* summary_text_divider_ = nullptr;
47 views::Label* summary_text_view_ = nullptr;
43 views::ImageView* app_icon_view_ = nullptr; 48 views::ImageView* app_icon_view_ = nullptr;
44 views::ImageButton* expand_button_ = nullptr; 49 views::ImageButton* expand_button_ = nullptr;
45 PaddedButton* settings_button_ = nullptr; 50 PaddedButton* settings_button_ = nullptr;
46 PaddedButton* close_button_ = nullptr; 51 PaddedButton* close_button_ = nullptr;
47 52
48 bool settings_button_enabled_ = false; 53 bool settings_button_enabled_ = false;
49 bool close_button_enabled_ = false; 54 bool close_button_enabled_ = false;
50 bool is_control_buttons_visible_ = false; 55 bool is_control_buttons_visible_ = false;
56 bool has_summary_text_ = false;
51 57
52 DISALLOW_COPY_AND_ASSIGN(NotificationHeaderView); 58 DISALLOW_COPY_AND_ASSIGN(NotificationHeaderView);
53 }; 59 };
54 60
55 } // namespace message_center 61 } // namespace message_center
56 62
57 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_ 63 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_HEADER_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/views/notification_header_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698