| 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 "grit/ui_strings.h" | 7 #include "grit/ui_strings.h" |
| 8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 bool checked() const { | 77 bool checked() const { |
| 78 return checkbox_->checked(); | 78 return checkbox_->checked(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 const Notifier& notifier() const { | 81 const Notifier& notifier() const { |
| 82 return *notifier_.get(); | 82 return *notifier_.get(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // views::ButtonListener overrides: | 86 // Overridden from views::ButtonListener: |
| 87 virtual void ButtonPressed(views::Button* button, | 87 virtual void ButtonPressed(views::Button* button, |
| 88 const ui::Event& event) OVERRIDE { | 88 const ui::Event& event) OVERRIDE { |
| 89 DCHECK(button == checkbox_); | 89 DCHECK(button == checkbox_); |
| 90 // The checkbox state has already changed at this point, but we'll update | 90 // The checkbox state has already changed at this point, but we'll update |
| 91 // the state on NotifierSettingsView::ButtonPressed() too, so here change | 91 // the state on NotifierSettingsView::ButtonPressed() too, so here change |
| 92 // back to the previous state. | 92 // back to the previous state. |
| 93 checkbox_->SetChecked(!checkbox_->checked()); | 93 checkbox_->SetChecked(!checkbox_->checked()); |
| 94 CustomButton::NotifyClick(event); | 94 CustomButton::NotifyClick(event); |
| 95 } | 95 } |
| 96 | 96 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 std::set<NotifierButton*>::iterator iter = buttons_.find( | 192 std::set<NotifierButton*>::iterator iter = buttons_.find( |
| 193 static_cast<NotifierButton*>(sender)); | 193 static_cast<NotifierButton*>(sender)); |
| 194 DCHECK(iter != buttons_.end()); | 194 DCHECK(iter != buttons_.end()); |
| 195 | 195 |
| 196 (*iter)->SetChecked(!(*iter)->checked()); | 196 (*iter)->SetChecked(!(*iter)->checked()); |
| 197 if (delegate_) | 197 if (delegate_) |
| 198 delegate_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 198 delegate_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace message_center | 201 } // namespace message_center |
| OLD | NEW |