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

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

Issue 7196002: Fix checkbox in windows uninstaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Uploading after sync merge Created 9 years, 6 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/gfx/native_theme_win.cc ('k') | views/controls/button/text_button.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/button/checkbox.h" 5 #include "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 "views/controls/label.h" 10 #include "views/controls/label.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 extra)); 293 extra));
294 gfx::Insets insets = GetInsets(); 294 gfx::Insets insets = GetInsets();
295 int y_offset = (height() - size.height()) / 2; 295 int y_offset = (height() - size.height()) / 2;
296 gfx::Rect rect(insets.left(), y_offset, size.width(), size.height()); 296 gfx::Rect rect(insets.left(), y_offset, size.width(), size.height());
297 rect.set_x(GetMirroredXForRect(rect)); 297 rect.set_x(GetMirroredXForRect(rect));
298 return rect; 298 return rect;
299 } 299 }
300 300
301 void Checkbox::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const { 301 void Checkbox::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
302 TextButtonBase::GetExtraParams(params); 302 TextButtonBase::GetExtraParams(params);
303 params->button.is_default = false;
304 params->button.checked = checked_; 303 params->button.checked = checked_;
305 } 304 }
306 305
307 gfx::Rect Checkbox::GetTextBounds() const { 306 gfx::Rect Checkbox::GetTextBounds() const {
308 gfx::Rect bounds(TextButtonBase::GetTextBounds()); 307 gfx::Rect bounds(TextButtonBase::GetTextBounds());
309 gfx::NativeTheme::ExtraParams extra; 308 gfx::NativeTheme::ExtraParams extra;
310 gfx::NativeTheme::State state = GetThemeState(&extra); 309 gfx::NativeTheme::State state = GetThemeState(&extra);
311 gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(), 310 gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
312 state, 311 state,
313 extra)); 312 extra));
314 bounds.Offset(size.width() + kCheckboxLabelSpacing, 0); 313 bounds.Offset(size.width() + kCheckboxLabelSpacing, 0);
315 return bounds; 314 return bounds;
316 } 315 }
317 316
318 } // namespace views 317 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/native_theme_win.cc ('k') | views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698