| Index: ui/views/controls/button/checkbox.cc
|
| ===================================================================
|
| --- ui/views/controls/button/checkbox.cc (revision 137002)
|
| +++ ui/views/controls/button/checkbox.cc (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -36,10 +36,11 @@
|
|
|
| gfx::Size Checkbox::GetPreferredSize() {
|
| gfx::Size prefsize(TextButtonBase::GetPreferredSize());
|
| - ui::NativeTheme::ExtraParams extra;
|
| - ui::NativeTheme::State state = GetThemeState(&extra);
|
| - gfx::Size size = ui::NativeTheme::instance()->GetPartSize(GetThemePart(),
|
| - state, extra);
|
| + gfx::NativeTheme::ExtraParams extra;
|
| + gfx::NativeTheme::State state = GetThemeState(&extra);
|
| + gfx::Size size = gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
|
| + state,
|
| + extra);
|
| prefsize.Enlarge(size.width(), 0);
|
| prefsize.set_height(std::max(prefsize.height(), size.height()));
|
|
|
| @@ -75,15 +76,16 @@
|
| TextButtonBase::NotifyClick(event);
|
| }
|
|
|
| -ui::NativeTheme::Part Checkbox::GetThemePart() const {
|
| - return ui::NativeTheme::kCheckbox;
|
| +gfx::NativeTheme::Part Checkbox::GetThemePart() const {
|
| + return gfx::NativeTheme::kCheckbox;
|
| }
|
|
|
| gfx::Rect Checkbox::GetThemePaintRect() const {
|
| - ui::NativeTheme::ExtraParams extra;
|
| - ui::NativeTheme::State state = GetThemeState(&extra);
|
| - gfx::Size size(ui::NativeTheme::instance()->GetPartSize(GetThemePart(), state,
|
| - extra));
|
| + gfx::NativeTheme::ExtraParams extra;
|
| + gfx::NativeTheme::State state = GetThemeState(&extra);
|
| + gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
|
| + state,
|
| + extra));
|
| gfx::Insets insets = GetInsets();
|
| int y_offset = (height() - size.height()) / 2;
|
| gfx::Rect rect(insets.left(), y_offset, size.width(), size.height());
|
| @@ -91,17 +93,18 @@
|
| return rect;
|
| }
|
|
|
| -void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
|
| +void Checkbox::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
|
| TextButtonBase::GetExtraParams(params);
|
| params->button.checked = checked_;
|
| }
|
|
|
| gfx::Rect Checkbox::GetTextBounds() const {
|
| gfx::Rect bounds(TextButtonBase::GetTextBounds());
|
| - ui::NativeTheme::ExtraParams extra;
|
| - ui::NativeTheme::State state = GetThemeState(&extra);
|
| - gfx::Size size(ui::NativeTheme::instance()->GetPartSize(GetThemePart(), state,
|
| - extra));
|
| + gfx::NativeTheme::ExtraParams extra;
|
| + gfx::NativeTheme::State state = GetThemeState(&extra);
|
| + gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
|
| + state,
|
| + extra));
|
| bounds.Offset(size.width() + kCheckboxLabelSpacing, 0);
|
| return bounds;
|
| }
|
|
|