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" |
11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
15 #include "ui/message_center/message_center_style.h" | 15 #include "ui/message_center/message_center_style.h" |
16 #include "ui/views/background.h" | 16 #include "ui/views/background.h" |
17 #include "ui/views/border.h" | 17 #include "ui/views/border.h" |
18 #include "ui/views/controls/button/checkbox.h" | 18 #include "ui/views/controls/button/checkbox.h" |
19 #include "ui/views/controls/button/custom_button.h" | 19 #include "ui/views/controls/button/custom_button.h" |
20 #include "ui/views/controls/image_view.h" | 20 #include "ui/views/controls/image_view.h" |
21 #include "ui/views/controls/label.h" | 21 #include "ui/views/controls/label.h" |
22 #include "ui/views/controls/scroll_view.h" | 22 #include "ui/views/controls/scroll_view.h" |
23 #include "ui/views/controls/scrollbar/kennedy_scroll_bar.h" | 23 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
24 #include "ui/views/layout/box_layout.h" | 24 #include "ui/views/layout/box_layout.h" |
25 #include "ui/views/widget/widget.h" | 25 #include "ui/views/widget/widget.h" |
26 | 26 |
27 #if defined(USE_AURA) | 27 #if defined(USE_AURA) |
28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
29 #endif | 29 #endif |
30 | 30 |
31 namespace message_center { | 31 namespace message_center { |
32 namespace { | 32 namespace { |
33 | 33 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 views::Label* title_label = new views::Label( | 283 views::Label* title_label = new views::Label( |
284 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL), | 284 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL), |
285 title_font); | 285 title_font); |
286 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 286 title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
287 title_label->SetMultiLine(true); | 287 title_label->SetMultiLine(true); |
288 title_entry_ = new EntryView(title_label); | 288 title_entry_ = new EntryView(title_label); |
289 AddChildView(title_entry_); | 289 AddChildView(title_entry_); |
290 | 290 |
291 scroller_ = new views::ScrollView(); | 291 scroller_ = new views::ScrollView(); |
292 scroller_->set_border(new Separator()); | 292 scroller_->set_border(new Separator()); |
293 scroller_->SetVerticalScrollBar(new views::KennedyScrollBar(false)); | 293 scroller_->SetVerticalScrollBar(new views::OverlayScrollBar(false)); |
294 AddChildView(scroller_); | 294 AddChildView(scroller_); |
295 | 295 |
296 views::View* contents_view = new views::View(); | 296 views::View* contents_view = new views::View(); |
297 contents_view->SetLayoutManager(new views::BoxLayout( | 297 contents_view->SetLayoutManager(new views::BoxLayout( |
298 views::BoxLayout::kVertical, 0, 0, 0)); | 298 views::BoxLayout::kVertical, 0, 0, 0)); |
299 | 299 |
300 views::Label* top_label = new views::Label(l10n_util::GetStringUTF16( | 300 views::Label* top_label = new views::Label(l10n_util::GetStringUTF16( |
301 IDS_MESSAGE_CENTER_SETTINGS_DIALOG_DESCRIPTION)); | 301 IDS_MESSAGE_CENTER_SETTINGS_DIALOG_DESCRIPTION)); |
302 top_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 302 top_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
303 top_label->SetMultiLine(true); | 303 top_label->SetMultiLine(true); |
(...skipping 87 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 |