Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: ui/message_center/views/notifier_settings_view.cc

Issue 1682603002: [UI Views] Don't allow a ButtonListener and a MenuButtonListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 settings::kTitleMargin + kMenuButtonInnateMargin, 571 settings::kTitleMargin + kMenuButtonInnateMargin,
572 0, 572 0,
573 settings::kTitleMargin + kMenuButtonInnateMargin)); 573 settings::kTitleMargin + kMenuButtonInnateMargin));
574 contents_title_view->AddChildView(top_label); 574 contents_title_view->AddChildView(top_label);
575 575
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(NULL, notifier_group_text, this, true); 581 new views::MenuButton(notifier_group_text, this, true);
582 notifier_group_selector_->SetBorder(scoped_ptr<views::Border>( 582 notifier_group_selector_->SetBorder(scoped_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_->SetFocusable(true); 586 notifier_group_selector_->SetFocusable(true);
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
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 notifier_group_selector_, 700 notifier_group_selector_,
701 menu_anchor, 701 menu_anchor,
702 views::MENU_ANCHOR_BUBBLE_ABOVE, 702 views::MENU_ANCHOR_BUBBLE_ABOVE,
703 ui::MENU_SOURCE_MOUSE)) 703 ui::MENU_SOURCE_MOUSE))
704 return; 704 return;
705 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); 705 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent());
706 center_view->OnSettingsChanged(); 706 center_view->OnSettingsChanged();
707 } 707 }
708 708
709 } // namespace message_center 709 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698