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