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.h" | 5 #include "ui/message_center/notifier_settings.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 delete icon_view_; | 56 delete icon_view_; |
57 icon_view_ = NULL; | 57 icon_view_ = NULL; |
58 } else { | 58 } else { |
59 if (!icon_view_) { | 59 if (!icon_view_) { |
60 icon_view_ = new views::ImageView(); | 60 icon_view_ = new views::ImageView(); |
61 AddChildViewAt(icon_view_, 1); | 61 AddChildViewAt(icon_view_, 1); |
62 } | 62 } |
63 icon_view_->SetImage(icon); | 63 icon_view_->SetImage(icon); |
64 icon_view_->SetImageSize(gfx::Size(kSettingsIconSize, kSettingsIconSize)); | 64 icon_view_->SetImageSize(gfx::Size(kSettingsIconSize, kSettingsIconSize)); |
65 } | 65 } |
| 66 Layout(); |
66 SchedulePaint(); | 67 SchedulePaint(); |
67 } | 68 } |
68 | 69 |
69 void SetChecked(bool checked) { | 70 void SetChecked(bool checked) { |
70 checkbox_->SetChecked(checked); | 71 checkbox_->SetChecked(checked); |
71 notifier_.enabled = checked; | 72 notifier_.enabled = checked; |
72 } | 73 } |
73 | 74 |
74 bool checked() const { | 75 bool checked() const { |
75 return checkbox_->checked(); | 76 return checkbox_->checked(); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 const ui::Event& event) { | 184 const ui::Event& event) { |
184 std::set<NotifierButton*>::iterator iter = buttons_.find( | 185 std::set<NotifierButton*>::iterator iter = buttons_.find( |
185 static_cast<NotifierButton*>(sender)); | 186 static_cast<NotifierButton*>(sender)); |
186 DCHECK(iter != buttons_.end()); | 187 DCHECK(iter != buttons_.end()); |
187 | 188 |
188 (*iter)->SetChecked(!(*iter)->checked()); | 189 (*iter)->SetChecked(!(*iter)->checked()); |
189 delegate_->SetNotifierEnabled((*iter)->id(), (*iter)->checked()); | 190 delegate_->SetNotifierEnabled((*iter)->id(), (*iter)->checked()); |
190 } | 191 } |
191 | 192 |
192 } // namespace message_center | 193 } // namespace message_center |
OLD | NEW |