| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/notifier_settings_view.h" | 5 #include "ui/message_center/views/notifier_settings_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| 227 | 227 |
| 228 // NotifierSettingsView::NotifierButton --------------------------------------- | 228 // NotifierSettingsView::NotifierButton --------------------------------------- |
| 229 | 229 |
| 230 // We do not use views::Checkbox class directly because it doesn't support | 230 // We do not use views::Checkbox class directly because it doesn't support |
| 231 // showing 'icon'. | 231 // showing 'icon'. |
| 232 NotifierSettingsView::NotifierButton::NotifierButton( | 232 NotifierSettingsView::NotifierButton::NotifierButton( |
| 233 NotifierSettingsProvider* provider, | 233 NotifierSettingsProvider* provider, |
| 234 std::unique_ptr<Notifier> notifier, | 234 std::unique_ptr<Notifier> notifier, |
| 235 views::ButtonListener* listener) | 235 views::ImageButtonDelegate* listener) |
| 236 : views::CustomButton(listener), | 236 : views::CustomButton(listener), |
| 237 provider_(provider), | 237 provider_(provider), |
| 238 notifier_(std::move(notifier)), | 238 notifier_(std::move(notifier)), |
| 239 icon_view_(new views::ImageView()), | 239 icon_view_(new views::ImageView()), |
| 240 name_view_(new views::Label(notifier_->name)), | 240 name_view_(new views::Label(notifier_->name)), |
| 241 checkbox_(new views::Checkbox(base::string16())), | 241 checkbox_(new views::Checkbox(base::string16())), |
| 242 learn_more_(nullptr) { | 242 learn_more_(nullptr) { |
| 243 DCHECK(provider_); | 243 DCHECK(provider_); |
| 244 DCHECK(notifier_); | 244 DCHECK(notifier_); |
| 245 | 245 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 628 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
| 629 } | 629 } |
| 630 | 630 |
| 631 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { | 631 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { |
| 632 provider_->SwitchToNotifierGroup(combobox->selected_index()); | 632 provider_->SwitchToNotifierGroup(combobox->selected_index()); |
| 633 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 633 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
| 634 center_view->OnSettingsChanged(); | 634 center_view->OnSettingsChanged(); |
| 635 } | 635 } |
| 636 | 636 |
| 637 } // namespace message_center | 637 } // namespace message_center |
| OLD | NEW |