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/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 views::View* content = child_at(0); | 72 views::View* content = child_at(0); |
73 int content_width = width() - kMarginWidth * 2; | 73 int content_width = width() - kMarginWidth * 2; |
74 int content_height = content->GetHeightForWidth(content_width); | 74 int content_height = content->GetHeightForWidth(content_width); |
75 int y = std::max((height() - content_height) / 2, 0); | 75 int y = std::max((height() - content_height) / 2, 0); |
76 content->SetBounds(kMarginWidth, y, content_width, content_height); | 76 content->SetBounds(kMarginWidth, y, content_width, content_height); |
77 } | 77 } |
78 | 78 |
79 gfx::Size EntryView::GetPreferredSize() { | 79 gfx::Size EntryView::GetPreferredSize() { |
80 DCHECK_EQ(1, child_count()); | 80 DCHECK_EQ(1, child_count()); |
81 gfx::Size size = child_at(0)->GetPreferredSize(); | 81 gfx::Size size = child_at(0)->GetPreferredSize(); |
82 size.ClampToMin(gfx::Size(kMinimumWindowWidth, kEntryHeight)); | 82 size.SetToMax(gfx::Size(kMinimumWindowWidth, kEntryHeight)); |
83 return size; | 83 return size; |
84 } | 84 } |
85 | 85 |
86 void EntryView::GetAccessibleState(ui::AccessibleViewState* state) { | 86 void EntryView::GetAccessibleState(ui::AccessibleViewState* state) { |
87 DCHECK_EQ(1, child_count()); | 87 DCHECK_EQ(1, child_count()); |
88 child_at(0)->GetAccessibleState(state); | 88 child_at(0)->GetAccessibleState(state); |
89 } | 89 } |
90 | 90 |
91 void EntryView::OnFocus() { | 91 void EntryView::OnFocus() { |
92 views::View::OnFocus(); | 92 views::View::OnFocus(); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 std::set<NotifierButton*>::iterator iter = buttons_.find( | 391 std::set<NotifierButton*>::iterator iter = buttons_.find( |
392 static_cast<NotifierButton*>(sender)); | 392 static_cast<NotifierButton*>(sender)); |
393 DCHECK(iter != buttons_.end()); | 393 DCHECK(iter != buttons_.end()); |
394 | 394 |
395 (*iter)->SetChecked(!(*iter)->checked()); | 395 (*iter)->SetChecked(!(*iter)->checked()); |
396 if (delegate_) | 396 if (delegate_) |
397 delegate_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 397 delegate_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
398 } | 398 } |
399 | 399 |
400 } // namespace message_center | 400 } // namespace message_center |
OLD | NEW |