| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 const Notifier& NotifierSettingsView::NotifierButton::notifier() const { | 317 const Notifier& NotifierSettingsView::NotifierButton::notifier() const { |
| 318 return *notifier_.get(); | 318 return *notifier_.get(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void NotifierSettingsView::NotifierButton::SendLearnMorePressedForTest() { | 321 void NotifierSettingsView::NotifierButton::SendLearnMorePressedForTest() { |
| 322 if (learn_more_ == nullptr) | 322 if (learn_more_ == nullptr) |
| 323 return; | 323 return; |
| 324 gfx::Point point(110, 120); | 324 gfx::Point point(110, 120); |
| 325 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, point, point, | 325 ui::MouseEvent pressed( |
| 326 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 326 ui::ET_MOUSE_PRESSED, point, point, ui::EventTimeForNow(), |
| 327 ui::EF_LEFT_MOUSE_BUTTON); | 327 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 328 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE, |
| 329 ui::PointerEvent::kMousePointerId)); |
| 328 ButtonPressed(learn_more_, pressed); | 330 ButtonPressed(learn_more_, pressed); |
| 329 } | 331 } |
| 330 | 332 |
| 331 void NotifierSettingsView::NotifierButton::ButtonPressed( | 333 void NotifierSettingsView::NotifierButton::ButtonPressed( |
| 332 views::Button* button, | 334 views::Button* button, |
| 333 const ui::Event& event) { | 335 const ui::Event& event) { |
| 334 if (button == checkbox_) { | 336 if (button == checkbox_) { |
| 335 // The checkbox state has already changed at this point, but we'll update | 337 // The checkbox state has already changed at this point, but we'll update |
| 336 // the state on NotifierSettingsView::ButtonPressed() too, so here change | 338 // the state on NotifierSettingsView::ButtonPressed() too, so here change |
| 337 // back to the previous state. | 339 // back to the previous state. |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); | 629 provider_->SetNotifierEnabled((*iter)->notifier(), (*iter)->checked()); |
| 628 } | 630 } |
| 629 | 631 |
| 630 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { | 632 void NotifierSettingsView::OnPerformAction(views::Combobox* combobox) { |
| 631 provider_->SwitchToNotifierGroup(combobox->selected_index()); | 633 provider_->SwitchToNotifierGroup(combobox->selected_index()); |
| 632 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); | 634 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); |
| 633 center_view->OnSettingsChanged(); | 635 center_view->OnSettingsChanged(); |
| 634 } | 636 } |
| 635 | 637 |
| 636 } // namespace message_center | 638 } // namespace message_center |
| OLD | NEW |