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

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

Issue 10827271: Replace views::Event with ui::Event. (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
« no previous file with comments | « ui/views/controls/button/checkbox.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/checkbox.h" 5 #include "ui/views/controls/button/checkbox.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/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/controls/label.h" 10 #include "ui/views/controls/label.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void Checkbox::OnPaintFocusBorder(gfx::Canvas* canvas) { 62 void Checkbox::OnPaintFocusBorder(gfx::Canvas* canvas) {
63 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) { 63 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
64 gfx::Rect bounds(GetTextBounds()); 64 gfx::Rect bounds(GetTextBounds());
65 // Increate the bounding box by one on each side so that that focus border 65 // Increate the bounding box by one on each side so that that focus border
66 // does not draw on top of the letters. 66 // does not draw on top of the letters.
67 bounds.Inset(-1, -1, -1, -1); 67 bounds.Inset(-1, -1, -1, -1);
68 canvas->DrawFocusRect(bounds); 68 canvas->DrawFocusRect(bounds);
69 } 69 }
70 } 70 }
71 71
72 void Checkbox::NotifyClick(const views::Event& event) { 72 void Checkbox::NotifyClick(const ui::Event& event) {
73 SetChecked(!checked()); 73 SetChecked(!checked());
74 RequestFocus(); 74 RequestFocus();
75 TextButtonBase::NotifyClick(event); 75 TextButtonBase::NotifyClick(event);
76 } 76 }
77 77
78 ui::NativeTheme::Part Checkbox::GetThemePart() const { 78 ui::NativeTheme::Part Checkbox::GetThemePart() const {
79 return ui::NativeTheme::kCheckbox; 79 return ui::NativeTheme::kCheckbox;
80 } 80 }
81 81
82 gfx::Rect Checkbox::GetThemePaintRect() const { 82 gfx::Rect Checkbox::GetThemePaintRect() const {
(...skipping 17 matching lines...) Expand all
100 gfx::Rect bounds(TextButtonBase::GetTextBounds()); 100 gfx::Rect bounds(TextButtonBase::GetTextBounds());
101 ui::NativeTheme::ExtraParams extra; 101 ui::NativeTheme::ExtraParams extra;
102 ui::NativeTheme::State state = GetThemeState(&extra); 102 ui::NativeTheme::State state = GetThemeState(&extra);
103 gfx::Size size(ui::NativeTheme::instance()->GetPartSize(GetThemePart(), state, 103 gfx::Size size(ui::NativeTheme::instance()->GetPartSize(GetThemePart(), state,
104 extra)); 104 extra));
105 bounds.Offset(size.width() + kCheckboxLabelSpacing, 0); 105 bounds.Offset(size.width() + kCheckboxLabelSpacing, 0);
106 return bounds; 106 return bounds;
107 } 107 }
108 108
109 } // namespace views 109 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/checkbox.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698