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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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 <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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 const Notifier& NotifierSettingsView::NotifierButton::notifier() const { 367 const Notifier& NotifierSettingsView::NotifierButton::notifier() const {
368 return *notifier_.get(); 368 return *notifier_.get();
369 } 369 }
370 370
371 void NotifierSettingsView::NotifierButton::SendLearnMorePressedForTest() { 371 void NotifierSettingsView::NotifierButton::SendLearnMorePressedForTest() {
372 if (learn_more_ == NULL) 372 if (learn_more_ == NULL)
373 return; 373 return;
374 gfx::Point point(110, 120); 374 gfx::Point point(110, 120);
375 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, point, point, 375 ui::MouseEvent pressed(
376 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 376 ui::ET_MOUSE_PRESSED, point, point, ui::EventTimeForNow(),
377 ui::EF_LEFT_MOUSE_BUTTON); 377 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
378 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
378 ButtonPressed(learn_more_, pressed); 379 ButtonPressed(learn_more_, pressed);
379 } 380 }
380 381
381 void NotifierSettingsView::NotifierButton::ButtonPressed( 382 void NotifierSettingsView::NotifierButton::ButtonPressed(
382 views::Button* button, 383 views::Button* button,
383 const ui::Event& event) { 384 const ui::Event& event) {
384 if (button == checkbox_) { 385 if (button == checkbox_) {
385 // The checkbox state has already changed at this point, but we'll update 386 // The checkbox state has already changed at this point, but we'll update
386 // the state on NotifierSettingsView::ButtonPressed() too, so here change 387 // the state on NotifierSettingsView::ButtonPressed() too, so here change
387 // back to the previous state. 388 // back to the previous state.
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 notifier_group_selector_, 697 notifier_group_selector_,
697 menu_anchor, 698 menu_anchor,
698 views::MENU_ANCHOR_BUBBLE_ABOVE, 699 views::MENU_ANCHOR_BUBBLE_ABOVE,
699 ui::MENU_SOURCE_MOUSE)) 700 ui::MENU_SOURCE_MOUSE))
700 return; 701 return;
701 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent()); 702 MessageCenterView* center_view = static_cast<MessageCenterView*>(parent());
702 center_view->OnSettingsChanged(); 703 center_view->OnSettingsChanged();
703 } 704 }
704 705
705 } // namespace message_center 706 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698