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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 checkbox_->SetChecked(notifier_->enabled); | 300 checkbox_->SetChecked(notifier_->enabled); |
301 checkbox_->set_listener(this); | 301 checkbox_->set_listener(this); |
302 checkbox_->SetFocusBehavior(FocusBehavior::NEVER); | 302 checkbox_->SetFocusBehavior(FocusBehavior::NEVER); |
303 checkbox_->SetAccessibleName(notifier_->name); | 303 checkbox_->SetAccessibleName(notifier_->name); |
304 | 304 |
305 if (ShouldHaveLearnMoreButton()) { | 305 if (ShouldHaveLearnMoreButton()) { |
306 // Create a more-info button that will be right-aligned. | 306 // Create a more-info button that will be right-aligned. |
307 learn_more_ = new views::ImageButton(this); | 307 learn_more_ = new views::ImageButton(this); |
308 learn_more_->SetFocusPainter(CreateFocusPainter()); | 308 learn_more_->SetFocusPainter(CreateFocusPainter()); |
309 learn_more_->set_request_focus_on_press(false); | 309 learn_more_->set_request_focus_on_press(false); |
310 learn_more_->SetFocusBehavior(FocusBehavior::ALWAYS); | 310 views::Button::ConfigureDefaultFocus(learn_more_); |
311 | 311 |
312 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 312 ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
313 learn_more_->SetImage( | 313 learn_more_->SetImage( |
314 views::Button::STATE_NORMAL, | 314 views::Button::STATE_NORMAL, |
315 rb.GetImageSkiaNamed(IDR_NOTIFICATION_ADVANCED_SETTINGS)); | 315 rb.GetImageSkiaNamed(IDR_NOTIFICATION_ADVANCED_SETTINGS)); |
316 learn_more_->SetImage( | 316 learn_more_->SetImage( |
317 views::Button::STATE_HOVERED, | 317 views::Button::STATE_HOVERED, |
318 rb.GetImageSkiaNamed(IDR_NOTIFICATION_ADVANCED_SETTINGS_HOVER)); | 318 rb.GetImageSkiaNamed(IDR_NOTIFICATION_ADVANCED_SETTINGS_HOVER)); |
319 learn_more_->SetImage( | 319 learn_more_->SetImage( |
320 views::Button::STATE_PRESSED, | 320 views::Button::STATE_PRESSED, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 if (need_account_switcher) { | 576 if (need_account_switcher) { |
577 const NotifierGroup& active_group = provider_->GetActiveNotifierGroup(); | 577 const NotifierGroup& active_group = provider_->GetActiveNotifierGroup(); |
578 base::string16 notifier_group_text = active_group.login_info.empty() ? | 578 base::string16 notifier_group_text = active_group.login_info.empty() ? |
579 active_group.name : active_group.login_info; | 579 active_group.name : active_group.login_info; |
580 notifier_group_selector_ = | 580 notifier_group_selector_ = |
581 new views::MenuButton(notifier_group_text, this, true); | 581 new views::MenuButton(notifier_group_text, this, true); |
582 notifier_group_selector_->SetBorder(std::unique_ptr<views::Border>( | 582 notifier_group_selector_->SetBorder(std::unique_ptr<views::Border>( |
583 new views::LabelButtonAssetBorder(views::Button::STYLE_BUTTON))); | 583 new views::LabelButtonAssetBorder(views::Button::STYLE_BUTTON))); |
584 notifier_group_selector_->SetFocusPainter(nullptr); | 584 notifier_group_selector_->SetFocusPainter(nullptr); |
585 notifier_group_selector_->set_animate_on_state_change(false); | 585 notifier_group_selector_->set_animate_on_state_change(false); |
586 notifier_group_selector_->SetFocusBehavior(FocusBehavior::ALWAYS); | 586 views::Button::ConfigureDefaultFocus(notifier_group_selector_); |
587 contents_title_view->AddChildView(notifier_group_selector_); | 587 contents_title_view->AddChildView(notifier_group_selector_); |
588 } | 588 } |
589 | 589 |
590 contents_view->AddChildView(contents_title_view); | 590 contents_view->AddChildView(contents_title_view); |
591 | 591 |
592 size_t notifier_count = notifiers.size(); | 592 size_t notifier_count = notifiers.size(); |
593 for (size_t i = 0; i < notifier_count; ++i) { | 593 for (size_t i = 0; i < notifier_count; ++i) { |
594 NotifierButton* button = new NotifierButton(provider_, notifiers[i], this); | 594 NotifierButton* button = new NotifierButton(provider_, notifiers[i], this); |
595 EntryView* entry = new EntryView(button); | 595 EntryView* entry = new EntryView(button); |
596 | 596 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 notifier_group_selector_, | 701 notifier_group_selector_, |
702 menu_anchor, | 702 menu_anchor, |
703 views::MENU_ANCHOR_BUBBLE_ABOVE, | 703 views::MENU_ANCHOR_BUBBLE_ABOVE, |
704 ui::MENU_SOURCE_MOUSE)) | 704 ui::MENU_SOURCE_MOUSE)) |
705 return; | 705 return; |
706 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 706 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
707 center_view->OnSettingsChanged(); | 707 center_view->OnSettingsChanged(); |
708 } | 708 } |
709 | 709 |
710 } // namespace message_center | 710 } // namespace message_center |
OLD | NEW |