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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 contents_title_view->AddChildView(top_label); | 569 contents_title_view->AddChildView(top_label); |
570 | 570 |
571 if (need_account_switcher) { | 571 if (need_account_switcher) { |
572 const NotifierGroup& active_group = provider_->GetActiveNotifierGroup(); | 572 const NotifierGroup& active_group = provider_->GetActiveNotifierGroup(); |
573 base::string16 notifier_group_text = active_group.login_info.empty() ? | 573 base::string16 notifier_group_text = active_group.login_info.empty() ? |
574 active_group.name : active_group.login_info; | 574 active_group.name : active_group.login_info; |
575 notifier_group_selector_ = | 575 notifier_group_selector_ = |
576 new views::MenuButton(NULL, notifier_group_text, this, true); | 576 new views::MenuButton(NULL, notifier_group_text, this, true); |
577 notifier_group_selector_->SetBorder(scoped_ptr<views::Border>( | 577 notifier_group_selector_->SetBorder(scoped_ptr<views::Border>( |
578 new views::LabelButtonBorder(views::Button::STYLE_BUTTON)).Pass()); | 578 new views::LabelButtonBorder(views::Button::STYLE_BUTTON)).Pass()); |
579 notifier_group_selector_->SetFocusPainter(scoped_ptr<views::Painter>()); | 579 notifier_group_selector_->SetFocusPainter(nullptr); |
580 notifier_group_selector_->set_animate_on_state_change(false); | 580 notifier_group_selector_->set_animate_on_state_change(false); |
581 notifier_group_selector_->SetFocusable(true); | 581 notifier_group_selector_->SetFocusable(true); |
582 contents_title_view->AddChildView(notifier_group_selector_); | 582 contents_title_view->AddChildView(notifier_group_selector_); |
583 } | 583 } |
584 | 584 |
585 contents_view->AddChildView(contents_title_view); | 585 contents_view->AddChildView(contents_title_view); |
586 | 586 |
587 size_t notifier_count = notifiers.size(); | 587 size_t notifier_count = notifiers.size(); |
588 for (size_t i = 0; i < notifier_count; ++i) { | 588 for (size_t i = 0; i < notifier_count; ++i) { |
589 NotifierButton* button = new NotifierButton(provider_, notifiers[i], this); | 589 NotifierButton* button = new NotifierButton(provider_, notifiers[i], this); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 notifier_group_selector_, | 695 notifier_group_selector_, |
696 menu_anchor, | 696 menu_anchor, |
697 views::MENU_ANCHOR_BUBBLE_ABOVE, | 697 views::MENU_ANCHOR_BUBBLE_ABOVE, |
698 ui::MENU_SOURCE_MOUSE)) | 698 ui::MENU_SOURCE_MOUSE)) |
699 return; | 699 return; |
700 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 700 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
701 center_view->OnSettingsChanged(); | 701 center_view->OnSettingsChanged(); |
702 } | 702 } |
703 | 703 |
704 } // namespace message_center | 704 } // namespace message_center |
OLD | NEW |