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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 return; | 679 return; |
680 | 680 |
681 (*iter)->SetChecked(!(*iter)->checked()); | 681 (*iter)->SetChecked(!(*iter)->checked()); |
682 if (provider_) | 682 if (provider_) |
683 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 683 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
684 } | 684 } |
685 | 685 |
686 void NotifierSettingsView::OnMenuButtonClicked(views::View* source, | 686 void NotifierSettingsView::OnMenuButtonClicked(views::View* source, |
687 const gfx::Point& point) { | 687 const gfx::Point& point) { |
688 notifier_group_menu_model_.reset(new NotifierGroupMenuModel(provider_)); | 688 notifier_group_menu_model_.reset(new NotifierGroupMenuModel(provider_)); |
689 notifier_group_menu_runner_.reset( | 689 notifier_group_menu_runner_.reset(new views::MenuRunner( |
690 new views::MenuRunner(notifier_group_menu_model_.get())); | 690 notifier_group_menu_model_.get(), views::MenuRunner::CONTEXT_MENU)); |
691 gfx::Rect menu_anchor = source->GetBoundsInScreen(); | 691 gfx::Rect menu_anchor = source->GetBoundsInScreen(); |
692 menu_anchor.Inset( | 692 menu_anchor.Inset( |
693 gfx::Insets(0, kMenuWhitespaceOffset, 0, kMenuWhitespaceOffset)); | 693 gfx::Insets(0, kMenuWhitespaceOffset, 0, kMenuWhitespaceOffset)); |
694 if (views::MenuRunner::MENU_DELETED == | 694 if (views::MenuRunner::MENU_DELETED == |
695 notifier_group_menu_runner_->RunMenuAt(GetWidget(), | 695 notifier_group_menu_runner_->RunMenuAt(GetWidget(), |
696 notifier_group_selector_, | 696 notifier_group_selector_, |
697 menu_anchor, | 697 menu_anchor, |
698 views::MENU_ANCHOR_BUBBLE_ABOVE, | 698 views::MENU_ANCHOR_BUBBLE_ABOVE, |
699 ui::MENU_SOURCE_MOUSE, | 699 ui::MENU_SOURCE_MOUSE)) |
700 views::MenuRunner::CONTEXT_MENU)) | |
701 return; | 700 return; |
702 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 701 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
703 center_view->OnSettingsChanged(); | 702 center_view->OnSettingsChanged(); |
704 } | 703 } |
705 | 704 |
706 } // namespace message_center | 705 } // namespace message_center |
OLD | NEW |