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

Side by Side Diff: ui/views/controls/button/radio_button.cc

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/controls/button/radio_button.h" 5 #include "ui/views/controls/button/radio_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 bool RadioButton::IsGroupFocusTraversable() const { 78 bool RadioButton::IsGroupFocusTraversable() const {
79 // When focusing a radio button with tab/shift+tab, only the selected button 79 // When focusing a radio button with tab/shift+tab, only the selected button
80 // from the group should be focused. 80 // from the group should be focused.
81 return false; 81 return false;
82 } 82 }
83 83
84 void RadioButton::OnFocus() { 84 void RadioButton::OnFocus() {
85 Checkbox::OnFocus(); 85 Checkbox::OnFocus();
86 SetChecked(true); 86 SetChecked(true);
87 views::MouseEvent event(ui::ET_MOUSE_PRESSED, 0, 0, 0); 87 ui::MouseEvent event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 0);
88 TextButtonBase::NotifyClick(event); 88 TextButtonBase::NotifyClick(event);
89 } 89 }
90 90
91 void RadioButton::NotifyClick(const ui::Event& event) { 91 void RadioButton::NotifyClick(const ui::Event& event) {
92 // Set the checked state to true only if we are unchecked, since we can't 92 // Set the checked state to true only if we are unchecked, since we can't
93 // be toggled on and off like a checkbox. 93 // be toggled on and off like a checkbox.
94 if (!checked()) 94 if (!checked())
95 SetChecked(true); 95 SetChecked(true);
96 RequestFocus(); 96 RequestFocus();
97 TextButtonBase::NotifyClick(event); 97 TextButtonBase::NotifyClick(event);
98 } 98 }
99 99
100 ui::NativeTheme::Part RadioButton::GetThemePart() const { 100 ui::NativeTheme::Part RadioButton::GetThemePart() const {
101 return ui::NativeTheme::kRadio; 101 return ui::NativeTheme::kRadio;
102 } 102 }
103 103
104 } // namespace views 104 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/controls/combobox/native_combobox_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698