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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 notifier_group_combobox_(nullptr), | 419 notifier_group_combobox_(nullptr), |
420 scroller_(nullptr), | 420 scroller_(nullptr), |
421 provider_(provider) { | 421 provider_(provider) { |
422 // |provider_| may be null in tests. | 422 // |provider_| may be null in tests. |
423 if (provider_) | 423 if (provider_) |
424 provider_->AddObserver(this); | 424 provider_->AddObserver(this); |
425 | 425 |
426 SetFocusBehavior(FocusBehavior::ALWAYS); | 426 SetFocusBehavior(FocusBehavior::ALWAYS); |
427 set_background( | 427 set_background( |
428 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); | 428 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); |
429 SetPaintToLayer(true); | 429 SetPaintToLayer(); |
430 | 430 |
431 title_label_ = new views::Label( | 431 title_label_ = new views::Label( |
432 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL), | 432 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL), |
433 ui::ResourceBundle::GetSharedInstance().GetFontList( | 433 ui::ResourceBundle::GetSharedInstance().GetFontList( |
434 ui::ResourceBundle::MediumFont)); | 434 ui::ResourceBundle::MediumFont)); |
435 title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 435 title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
436 title_label_->SetMultiLine(true); | 436 title_label_->SetMultiLine(true); |
437 title_label_->SetBorder( | 437 title_label_->SetBorder( |
438 views::CreateEmptyBorder(kComputedTitleTopMargin, kTitleMargin, | 438 views::CreateEmptyBorder(kComputedTitleTopMargin, kTitleMargin, |
439 kComputedTitleBottomMargin, kTitleMargin)); | 439 kComputedTitleBottomMargin, kTitleMargin)); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 628 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
629 } | 629 } |
630 | 630 |
631 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { | 631 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { |
632 provider_->SwitchToNotifierGroup(combobox->selected_index()); | 632 provider_->SwitchToNotifierGroup(combobox->selected_index()); |
633 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 633 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
634 center_view->OnSettingsChanged(); | 634 center_view->OnSettingsChanged(); |
635 } | 635 } |
636 | 636 |
637 } // namespace message_center | 637 } // namespace message_center |
OLD | NEW |