OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/message_center/views/message_center_button_bar.h" | 5 #include "ui/message_center/views/message_center_button_bar.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 gfx::Size NotificationCenterButton::GetPreferredSize() { return size_; } | 86 gfx::Size NotificationCenterButton::GetPreferredSize() { return size_; } |
87 | 87 |
88 // MessageCenterButtonBar ///////////////////////////////////////////////////// | 88 // MessageCenterButtonBar ///////////////////////////////////////////////////// |
89 /////////////////////////////////////////////////////////////////////////////// | 89 /////////////////////////////////////////////////////////////////////////////// |
90 MessageCenterButtonBar::MessageCenterButtonBar( | 90 MessageCenterButtonBar::MessageCenterButtonBar( |
91 MessageCenterView* message_center_view, | 91 MessageCenterView* message_center_view, |
92 MessageCenter* message_center, | 92 MessageCenter* message_center, |
93 NotifierSettingsProvider* notifier_settings_provider, | 93 NotifierSettingsProvider* notifier_settings_provider, |
94 bool settings_initially_visible) | 94 bool settings_initially_visible, |
| 95 const base::string16& title) |
95 : message_center_view_(message_center_view), | 96 : message_center_view_(message_center_view), |
96 message_center_(message_center), | 97 message_center_(message_center), |
97 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 98 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
98 close_bubble_button_(NULL), | 99 close_bubble_button_(NULL), |
99 #endif | 100 #endif |
100 title_arrow_(NULL), | 101 title_arrow_(NULL), |
101 notification_label_(NULL), | 102 notification_label_(NULL), |
102 button_container_(NULL), | 103 button_container_(NULL), |
103 close_all_button_(NULL), | 104 close_all_button_(NULL), |
104 settings_button_(NULL), | 105 settings_button_(NULL), |
105 quiet_mode_button_(NULL) { | 106 quiet_mode_button_(NULL) { |
106 SetPaintToLayer(true); | 107 SetPaintToLayer(true); |
107 set_background( | 108 set_background( |
108 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); | 109 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); |
109 | 110 |
110 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 111 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
111 | 112 |
112 title_arrow_ = new NotificationCenterButton(this, | 113 title_arrow_ = new NotificationCenterButton(this, |
113 IDR_NOTIFICATION_ARROW, | 114 IDR_NOTIFICATION_ARROW, |
114 IDR_NOTIFICATION_ARROW_HOVER, | 115 IDR_NOTIFICATION_ARROW_HOVER, |
115 IDR_NOTIFICATION_ARROW_PRESSED, | 116 IDR_NOTIFICATION_ARROW_PRESSED, |
116 0); | 117 0); |
117 title_arrow_->set_size(gfx::Size(kChevronWidth, kButtonSize)); | 118 title_arrow_->set_size(gfx::Size(kChevronWidth, kButtonSize)); |
118 | 119 |
119 // Keyboardists can use the gear button to switch modes. | 120 // Keyboardists can use the gear button to switch modes. |
120 title_arrow_->SetFocusable(false); | 121 title_arrow_->SetFocusable(false); |
121 AddChildView(title_arrow_); | 122 AddChildView(title_arrow_); |
122 | 123 |
123 notification_label_ = new views::Label( | 124 notification_label_ = new views::Label(title); |
124 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_FOOTER_TITLE)); | |
125 notification_label_->SetAutoColorReadabilityEnabled(false); | 125 notification_label_->SetAutoColorReadabilityEnabled(false); |
126 notification_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 126 notification_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
127 notification_label_->SetEnabledColor(kRegularTextColor); | 127 notification_label_->SetEnabledColor(kRegularTextColor); |
128 AddChildView(notification_label_); | 128 AddChildView(notification_label_); |
129 | 129 |
130 button_container_ = new views::View; | 130 button_container_ = new views::View; |
131 button_container_->SetLayoutManager( | 131 button_container_->SetLayoutManager( |
132 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); | 132 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); |
133 quiet_mode_button_ = new NotificationCenterButton( | 133 quiet_mode_button_ = new NotificationCenterButton( |
134 this, | 134 this, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 293 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
294 } else if (sender == close_bubble_button_) { | 294 } else if (sender == close_bubble_button_) { |
295 message_center_view()->tray()->HideMessageCenterBubble(); | 295 message_center_view()->tray()->HideMessageCenterBubble(); |
296 #endif | 296 #endif |
297 } else { | 297 } else { |
298 NOTREACHED(); | 298 NOTREACHED(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace message_center | 302 } // namespace message_center |
OLD | NEW |