summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 23:10:10 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 23:10:10 +0000
commit1e25fbf5e01d0ea8045c43288ee58fc7d0b3a3a2 (patch)
tree9f277e5e69c7b6a9586f827d425d6b66ea29d466 /ui
parent84d9ab4c2dc42dd7d18672c2855c92589bf9208b (diff)
downloadchromium_src-1e25fbf5e01d0ea8045c43288ee58fc7d0b3a3a2.zip
chromium_src-1e25fbf5e01d0ea8045c43288ee58fc7d0b3a3a2.tar.gz
chromium_src-1e25fbf5e01d0ea8045c43288ee58fc7d0b3a3a2.tar.bz2
Revert 136996 - ui: Move NativeTheme files into ui/base/native_theme/ directory.
BUG=103304,125844 R=ben@chromium.org TBR=tony@chromium.org Review URL: https://chromiumcodereview.appspot.com/10310136 TBR=tfarina@chromium.org Review URL: https://chromiumcodereview.appspot.com/10387121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/native_theme/native_theme_win_unittest.cc15
-rw-r--r--ui/gfx/native_theme.cc (renamed from ui/base/native_theme/native_theme.cc)10
-rw-r--r--ui/gfx/native_theme.h (renamed from ui/base/native_theme/native_theme.h)18
-rw-r--r--ui/gfx/native_theme_android.cc (renamed from ui/base/native_theme/native_theme_android.cc)42
-rw-r--r--ui/gfx/native_theme_android.h (renamed from ui/base/native_theme/native_theme_android.h)21
-rw-r--r--ui/gfx/native_theme_aura.cc (renamed from ui/base/native_theme/native_theme_aura.cc)6
-rw-r--r--ui/gfx/native_theme_aura.h (renamed from ui/base/native_theme/native_theme_aura.h)18
-rw-r--r--ui/gfx/native_theme_base.cc (renamed from ui/base/native_theme/native_theme_base.cc)6
-rw-r--r--ui/gfx/native_theme_base.h (renamed from ui/base/native_theme/native_theme_base.h)14
-rw-r--r--ui/gfx/native_theme_gtk.cc (renamed from ui/base/native_theme/native_theme_gtk.cc)6
-rw-r--r--ui/gfx/native_theme_gtk.h (renamed from ui/base/native_theme/native_theme_gtk.h)14
-rw-r--r--ui/gfx/native_theme_win.cc (renamed from ui/base/native_theme/native_theme_win.cc)34
-rw-r--r--ui/gfx/native_theme_win.h (renamed from ui/base/native_theme/native_theme_win.h)22
-rw-r--r--ui/gfx/native_theme_win_unittest.cc11
-rw-r--r--ui/gfx/render_text.cc22
-rw-r--r--ui/ui.gyp44
-rw-r--r--ui/ui_unittests.gypi6
-rw-r--r--ui/views/controls/button/checkbox.cc35
-rw-r--r--ui/views/controls/button/checkbox.h6
-rw-r--r--ui/views/controls/button/radio_button.cc6
-rw-r--r--ui/views/controls/button/radio_button.h4
-rw-r--r--ui/views/controls/button/text_button.cc80
-rw-r--r--ui/views/controls/button/text_button.h20
-rw-r--r--ui/views/controls/combobox/native_combobox_win.cc6
-rw-r--r--ui/views/controls/focusable_border.cc8
-rw-r--r--ui/views/controls/label.cc14
-rw-r--r--ui/views/controls/menu/menu_config_views.cc6
-rw-r--r--ui/views/controls/menu/menu_config_win.cc8
-rw-r--r--ui/views/controls/menu/menu_item_view.cc4
-rw-r--r--ui/views/controls/menu/menu_item_view.h4
-rw-r--r--ui/views/controls/menu/menu_item_view_views.cc12
-rw-r--r--ui/views/controls/menu/menu_item_view_win.cc14
-rw-r--r--ui/views/controls/menu/menu_scroll_view_container.cc4
-rw-r--r--ui/views/controls/menu/menu_separator_views.cc6
-rw-r--r--ui/views/controls/menu/menu_separator_win.cc16
-rw-r--r--ui/views/controls/menu/native_menu_win.cc4
-rw-r--r--ui/views/controls/scrollbar/native_scroll_bar_views.cc110
-rw-r--r--ui/views/controls/scrollbar/native_scroll_bar_views.h10
-rw-r--r--ui/views/controls/tabbed_pane/native_tabbed_pane_win.cc14
-rw-r--r--ui/views/controls/table/table_view_views.cc6
-rw-r--r--ui/views/controls/textfield/native_textfield_win.cc8
-rw-r--r--ui/views/controls/textfield/textfield_views_model.cc2
-rw-r--r--ui/views/controls/tree/tree_view_views.cc6
-rw-r--r--ui/views/examples/native_theme_button_example.cc61
-rw-r--r--ui/views/examples/native_theme_button_example.h18
-rw-r--r--ui/views/examples/native_theme_checkbox_example.h3
-rw-r--r--ui/views/native_theme_delegate.h18
-rw-r--r--ui/views/native_theme_painter.cc22
-rw-r--r--ui/views/widget/native_widget_win.cc4
-rw-r--r--ui/views/window/dialog_client_view.cc22
50 files changed, 421 insertions, 449 deletions
diff --git a/ui/base/native_theme/native_theme_win_unittest.cc b/ui/base/native_theme/native_theme_win_unittest.cc
deleted file mode 100644
index b711921..0000000
--- a/ui/base/native_theme/native_theme_win_unittest.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "ui/base/native_theme/native_theme_win.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace ui {
-
-TEST(NativeThemeTest, Init) {
- ASSERT_TRUE(NativeThemeWin::instance() != NULL);
-}
-
-} // namespace ui
diff --git a/ui/base/native_theme/native_theme.cc b/ui/gfx/native_theme.cc
index c467d7e..331d429 100644
--- a/ui/base/native_theme/native_theme.cc
+++ b/ui/gfx/native_theme.cc
@@ -1,10 +1,12 @@
-// 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.
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
-namespace ui {
+#include "ui/gfx/size.h"
+
+namespace gfx {
unsigned int NativeTheme::thumb_inactive_color_ = 0xeaeaea;
unsigned int NativeTheme::thumb_active_color_ = 0xf4f4f4;
@@ -21,4 +23,4 @@ void NativeTheme::SetScrollbarColors(unsigned inactive_color,
// NativeTheme::instance() is implemented in the platform specific source files,
// such as native_theme_win.cc or native_theme_linux.cc
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme.h b/ui/gfx/native_theme.h
index b37b1e7..2a83dba 100644
--- a/ui/base/native_theme/native_theme.h
+++ b/ui/gfx/native_theme.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
+#ifndef UI_GFX_NATIVE_THEME_H_
+#define UI_GFX_NATIVE_THEME_H_
#pragma once
#include "third_party/skia/include/core/SkColor.h"
@@ -13,11 +13,9 @@
class SkCanvas;
namespace gfx {
+
class Rect;
class Size;
-}
-
-namespace ui {
// This class supports drawing UI controls (like buttons, text fields, lists,
// comboboxes, etc) that look like the native UI controls of the underlying
@@ -200,9 +198,9 @@ class UI_EXPORT NativeTheme {
};
// Return the size of the part.
- virtual gfx::Size GetPartSize(Part part,
- State state,
- const ExtraParams& extra) const = 0;
+ virtual Size GetPartSize(Part part,
+ State state,
+ const ExtraParams& extra) const = 0;
// Paint the part to the canvas.
virtual void Paint(SkCanvas* canvas,
@@ -268,6 +266,6 @@ class UI_EXPORT NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeTheme);
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
+#endif // UI_GFX_NATIVE_THEME_H_
diff --git a/ui/base/native_theme/native_theme_android.cc b/ui/gfx/native_theme_android.cc
index 2f710f9..ca5cde1 100644
--- a/ui/base/native_theme/native_theme_android.cc
+++ b/ui/gfx/native_theme_android.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/native_theme/native_theme_android.h"
+#include "ui/gfx/native_theme_android.h"
#include <limits>
@@ -15,30 +15,32 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
-namespace {
+namespace gfx {
-const unsigned int kButtonLength = 14;
-const unsigned int kScrollbarWidth = 15;
-const unsigned int kThumbInactiveColor = 0xeaeaea;
-const unsigned int kTrackColor= 0xd3d3d3;
+static const unsigned int kButtonLength = 14;
+static const unsigned int kScrollbarWidth = 15;
+static const unsigned int kThumbInactiveColor = 0xeaeaea;
+static const unsigned int kTrackColor= 0xd3d3d3;
// These are the default dimensions of radio buttons and checkboxes.
-const int kCheckboxAndRadioWidth = 13;
-const int kCheckboxAndRadioHeight = 13;
+static const int kCheckboxAndRadioWidth = 13;
+static const int kCheckboxAndRadioHeight = 13;
// These sizes match the sizes in Chromium Win.
-const int kSliderThumbWidth = 11;
-const int kSliderThumbHeight = 21;
+static const int kSliderThumbWidth = 11;
+static const int kSliderThumbHeight = 21;
-const SkColor kSliderTrackBackgroundColor = SkColorSetRGB(0xe3, 0xdd, 0xd8);
-const SkColor kSliderThumbLightGrey = SkColorSetRGB(0xf4, 0xf2, 0xef);
-const SkColor kSliderThumbDarkGrey = SkColorSetRGB(0xea, 0xe5, 0xe0);
-const SkColor kSliderThumbBorderDarkGrey = SkColorSetRGB(0x9d, 0x96, 0x8e);
+static const SkColor kSliderTrackBackgroundColor =
+ SkColorSetRGB(0xe3, 0xdd, 0xd8);
+static const SkColor kSliderThumbLightGrey = SkColorSetRGB(0xf4, 0xf2, 0xef);
+static const SkColor kSliderThumbDarkGrey = SkColorSetRGB(0xea, 0xe5, 0xe0);
+static const SkColor kSliderThumbBorderDarkGrey =
+ SkColorSetRGB(0x9d, 0x96, 0x8e);
// Get lightness adjusted color.
-SkColor BrightenColor(const color_utils::HSL& hsl,
- SkAlpha alpha,
- double lightness_amount) {
+static SkColor BrightenColor(const color_utils::HSL& hsl,
+ SkAlpha alpha,
+ double lightness_amount) {
color_utils::HSL adjusted = hsl;
adjusted.l += lightness_amount;
if (adjusted.l > 1.0)
@@ -49,10 +51,6 @@ SkColor BrightenColor(const color_utils::HSL& hsl,
return color_utils::HSLToSkColor(adjusted, alpha);
}
-} // namespace
-
-namespace ui {
-
// static
const NativeTheme* NativeTheme::instance() {
return NativeThemeAndroid::instance();
@@ -803,4 +801,4 @@ SkColor NativeThemeAndroid::OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const {
return SaturateAndBrighten(hsv2, -0.2, diff);
}
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme_android.h b/ui/gfx/native_theme_android.h
index 6f183da..800c320 100644
--- a/ui/base/native_theme/native_theme_android.h
+++ b/ui/gfx/native_theme_android.h
@@ -2,31 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
-#pragma once
+#ifndef UI_GFX_NATIVE_THEME_ANDROID_H_
+#define UI_GFX_NATIVE_THEME_ANDROID_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "skia/ext/platform_canvas.h"
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
namespace gfx {
class Rect;
class Size;
-}
-
-namespace ui {
+// Android theming API.
class NativeThemeAndroid : public NativeTheme {
public:
// Gets our singleton instance.
static const NativeThemeAndroid* instance();
// Return the size of the part.
- virtual gfx::Size GetPartSize(Part part,
- State state,
- const ExtraParams& extra) const OVERRIDE;
+ virtual Size GetPartSize(Part part,
+ State state,
+ const ExtraParams& extra) const OVERRIDE;
// Paint the part to the canvas.
virtual void Paint(SkCanvas* canvas,
@@ -170,6 +167,6 @@ class NativeThemeAndroid : public NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeThemeAndroid);
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
+#endif // UI_GFX_NATIVE_THEME_ANDROID_H_
diff --git a/ui/base/native_theme/native_theme_aura.cc b/ui/gfx/native_theme_aura.cc
index 56336c0..b3be18b 100644
--- a/ui/base/native_theme/native_theme_aura.cc
+++ b/ui/gfx/native_theme_aura.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/native_theme/native_theme_aura.h"
+#include "ui/gfx/native_theme_aura.h"
#include "base/logging.h"
#include "grit/gfx_resources.h"
@@ -49,7 +49,7 @@ const SkColor kTextfieldSelectionColor =
} // namespace
-namespace ui {
+namespace gfx {
// static
const NativeTheme* NativeTheme::instance() {
@@ -292,4 +292,4 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas,
}
}
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme_aura.h b/ui/gfx/native_theme_aura.h
index 3eb05c2..de4b10d 100644
--- a/ui/base/native_theme/native_theme_aura.h
+++ b/ui/gfx/native_theme_aura.h
@@ -2,21 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
+#ifndef UI_GFX_NATIVE_THEME_AURA_H_
+#define UI_GFX_NATIVE_THEME_AURA_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "ui/base/native_theme/native_theme_base.h"
+#include "ui/gfx/native_theme_base.h"
-namespace gfx{
-class Rect;
-class Size;
-}
-
-namespace ui {
+namespace gfx {
+// Aura implementation of native theme support.
class NativeThemeAura : public NativeThemeBase {
public:
static const NativeThemeAura* instance();
@@ -47,6 +43,6 @@ class NativeThemeAura : public NativeThemeBase {
DISALLOW_COPY_AND_ASSIGN(NativeThemeAura);
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
+#endif // UI_GFX_NATIVE_THEME_AURA_H_
diff --git a/ui/base/native_theme/native_theme_base.cc b/ui/gfx/native_theme_base.cc
index 4f86670..6168382 100644
--- a/ui/base/native_theme/native_theme_base.cc
+++ b/ui/gfx/native_theme_base.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/native_theme/native_theme_base.h"
+#include "ui/gfx/native_theme_base.h"
#include <limits>
@@ -51,7 +51,7 @@ SkColor BrightenColor(const color_utils::HSL& hsl, SkAlpha alpha,
} // namespace
-namespace ui {
+namespace gfx {
gfx::Size NativeThemeBase::GetPartSize(Part part,
State state,
@@ -970,4 +970,4 @@ SkColor NativeThemeBase::OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const {
return SaturateAndBrighten(hsv2, -0.2f, diff);
}
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme_base.h b/ui/gfx/native_theme_base.h
index 5cc86fe..562f934 100644
--- a/ui/base/native_theme/native_theme_base.h
+++ b/ui/gfx/native_theme_base.h
@@ -2,21 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
-#pragma once
+#ifndef UI_GFX_NATIVE_THEME_BASE_H_
+#define UI_GFX_NATIVE_THEME_BASE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "skia/ext/platform_canvas.h"
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
namespace gfx {
class Rect;
class Size;
-}
-
-namespace ui {
// Theme support for non-Windows toolkits.
class NativeThemeBase : public NativeTheme {
@@ -166,6 +162,6 @@ class NativeThemeBase : public NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
+#endif // UI_GFX_NATIVE_THEME_BASE_H_
diff --git a/ui/base/native_theme/native_theme_gtk.cc b/ui/gfx/native_theme_gtk.cc
index d8eab30..53d2636 100644
--- a/ui/base/native_theme/native_theme_gtk.cc
+++ b/ui/gfx/native_theme_gtk.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/native_theme/native_theme_gtk.h"
+#include "ui/gfx/native_theme_gtk.h"
#include <gtk/gtk.h>
@@ -29,7 +29,7 @@ const SkColor kTextButtonHoverColor = kTextButtonEnabledColor;
} // namespace
-namespace ui {
+namespace gfx {
// static
const NativeTheme* NativeTheme::instance() {
@@ -84,4 +84,4 @@ NativeThemeGtk::NativeThemeGtk() {
NativeThemeGtk::~NativeThemeGtk() {
}
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme_gtk.h b/ui/gfx/native_theme_gtk.h
index 257d49f..2fb205c 100644
--- a/ui/base/native_theme/native_theme_gtk.h
+++ b/ui/gfx/native_theme_gtk.h
@@ -1,14 +1,14 @@
-// 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.
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
+#ifndef UI_GFX_NATIVE_THEME_GTK_H_
+#define UI_GFX_NATIVE_THEME_GTK_H_
#pragma once
-#include "ui/base/native_theme/native_theme_base.h"
+#include "ui/gfx/native_theme_base.h"
-namespace ui {
+namespace gfx {
// GTK implementation of native theme support.
class NativeThemeGtk : public NativeThemeBase {
@@ -22,6 +22,6 @@ class NativeThemeGtk : public NativeThemeBase {
virtual ~NativeThemeGtk();
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
+#endif // UI_GFX_NATIVE_THEME_GTK_H_
diff --git a/ui/base/native_theme/native_theme_win.cc b/ui/gfx/native_theme_win.cc
index abe605f..28574a2 100644
--- a/ui/base/native_theme/native_theme_win.cc
+++ b/ui/gfx/native_theme_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/native_theme/native_theme_win.h"
+#include "ui/gfx/native_theme_win.h"
#include <windows.h>
#include <uxtheme.h>
@@ -120,7 +120,7 @@ RECT InsetRect(const RECT* rect, int size) {
} // namespace
-namespace ui {
+namespace gfx {
bool NativeThemeWin::IsThemingActive() const {
if (is_theme_active_)
@@ -156,14 +156,14 @@ SkColor NativeThemeWin::GetThemeColorWithDefault(ThemeName theme,
return color;
}
-gfx::Size NativeThemeWin::GetThemeBorderSize(ThemeName theme) const {
+Size NativeThemeWin::GetThemeBorderSize(ThemeName theme) const {
// For simplicity use the wildcard state==0, part==0, since it works
// for the cases we currently depend on.
int border;
if (GetThemeInt(theme, 0, 0, TMT_BORDERSIZE, &border) == S_OK)
- return gfx::Size(border, border);
+ return Size(border, border);
else
- return gfx::Size(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
+ return Size(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
}
void NativeThemeWin::DisableTheming() const {
@@ -279,7 +279,7 @@ gfx::Size NativeThemeWin::GetPartSize(Part part,
}
}
- return gfx::Size(size.cx, size.cy);
+ return Size(size.cx, size.cy);
}
void NativeThemeWin::Paint(SkCanvas* canvas,
@@ -648,7 +648,7 @@ HRESULT NativeThemeWin::PaintMenuArrow(HDC hdc,
// it doesn't have a flag equivalent to DFCS_MENUARROWRIGHT. But they
// are needed for RTL locales on Vista. So use a memory DC and mirror
// the region with GDI's StretchBlt.
- gfx::Rect r(rect);
+ Rect r(rect);
base::win::ScopedCreateDC mem_dc(CreateCompatibleDC(hdc));
base::win::ScopedBitmap mem_bitmap(CreateCompatibleBitmap(hdc, r.width(),
r.height()));
@@ -984,16 +984,16 @@ HRESULT NativeThemeWin::PaintScrollbarThumb(
int state_id;
switch (part) {
- case NativeTheme::kScrollbarHorizontalThumb:
+ case gfx::NativeTheme::kScrollbarHorizontalThumb:
part_id = SBP_THUMBBTNHORZ;
break;
- case NativeTheme::kScrollbarVerticalThumb:
+ case gfx::NativeTheme::kScrollbarVerticalThumb:
part_id = SBP_THUMBBTNVERT;
break;
- case NativeTheme::kScrollbarHorizontalGripper:
+ case gfx::NativeTheme::kScrollbarHorizontalGripper:
part_id = SBP_GRIPPERHORZ;
break;
- case NativeTheme::kScrollbarVerticalGripper:
+ case gfx::NativeTheme::kScrollbarVerticalGripper:
part_id = SBP_GRIPPERVERT;
break;
default:
@@ -1042,10 +1042,10 @@ HRESULT NativeThemeWin::PaintScrollbarTrack(
int state_id;
switch (part) {
- case NativeTheme::kScrollbarHorizontalTrack:
+ case gfx::NativeTheme::kScrollbarHorizontalTrack:
part_id = extra.is_upper ? SBP_UPPERTRACKHORZ : SBP_LOWERTRACKHORZ;
break;
- case NativeTheme::kScrollbarVerticalTrack:
+ case gfx::NativeTheme::kScrollbarVerticalTrack:
part_id = extra.is_upper ? SBP_UPPERTRACKVERT : SBP_LOWERTRACKVERT;
break;
default:
@@ -1696,15 +1696,15 @@ HRESULT NativeThemeWin::PaintFrameControl(HDC hdc,
int bg_color_key;
int text_color_key;
switch (control_state) {
- case NativeTheme::kHovered:
+ case gfx::NativeTheme::kHovered:
bg_color_key = COLOR_HIGHLIGHT;
text_color_key = COLOR_HIGHLIGHTTEXT;
break;
- case NativeTheme::kNormal:
+ case gfx::NativeTheme::kNormal:
bg_color_key = COLOR_MENU;
text_color_key = COLOR_MENUTEXT;
break;
- case NativeTheme::kDisabled:
+ case gfx::NativeTheme::kDisabled:
bg_color_key = is_selected ? COLOR_HIGHLIGHT : COLOR_MENU;
text_color_key = COLOR_GRAYTEXT;
break;
@@ -1776,4 +1776,4 @@ HANDLE NativeThemeWin::GetThemeHandle(ThemeName theme_name) const {
return handle;
}
-} // namespace ui
+} // namespace gfx
diff --git a/ui/base/native_theme/native_theme_win.h b/ui/gfx/native_theme_win.h
index 260de8d..8427442 100644
--- a/ui/base/native_theme/native_theme_win.h
+++ b/ui/gfx/native_theme_win.h
@@ -1,29 +1,29 @@
-// 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.
-
-#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_
-#define UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_
-#pragma once
-
+//
// A wrapper class for working with custom XP/Vista themes provided in
// uxtheme.dll. This is a singleton class that can be grabbed using
// NativeThemeWin::instance().
// For more information on visual style parts and states, see:
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp
+#ifndef UI_GFX_NATIVE_THEME_WIN_H_
+#define UI_GFX_NATIVE_THEME_WIN_H_
+#pragma once
+
#include <windows.h>
#include <uxtheme.h>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/size.h"
class SkCanvas;
-namespace ui {
+namespace gfx {
// Windows implementation of native theme class.
//
@@ -69,7 +69,7 @@ class UI_EXPORT NativeThemeWin : public NativeTheme {
// Get the thickness of the border associated with the specified theme,
// defaulting to GetSystemMetrics edge size if themes are disabled.
// In Classic Windows, borders are typically 2px; on XP+, they are 1px.
- gfx::Size GetThemeBorderSize(ThemeName theme) const;
+ Size GetThemeBorderSize(ThemeName theme) const;
// Disables all theming for top-level windows in the entire process, from
// when this method is called until the process exits. All the other
@@ -326,6 +326,6 @@ class UI_EXPORT NativeThemeWin : public NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeThemeWin);
};
-} // namespace ui
+} // namespace gfx
-#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_
+#endif // UI_GFX_NATIVE_THEME_WIN_H_
diff --git a/ui/gfx/native_theme_win_unittest.cc b/ui/gfx/native_theme_win_unittest.cc
new file mode 100644
index 0000000..cce3861
--- /dev/null
+++ b/ui/gfx/native_theme_win_unittest.cc
@@ -0,0 +1,11 @@
+// Copyright (c) 2009 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.
+
+#include "ui/gfx/native_theme_win.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(NativeThemeTest, Init) {
+ ASSERT_TRUE(gfx::NativeThemeWin::instance() != NULL);
+}
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 3c8b720..79ded6f 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -15,12 +15,11 @@
#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "third_party/skia/include/effects/SkLayerDrawLooper.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/text/utf16_indexing.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/insets.h"
-#include "ui/gfx/shadow_value.h"
#include "ui/gfx/skia_util.h"
+#include "ui/gfx/shadow_value.h"
namespace {
@@ -738,12 +737,7 @@ void RenderText::ApplyCompositionAndSelectionStyles(
// Apply a selection style override to a copy of the style ranges.
if (!selection().is_empty()) {
StyleRange selection_style(default_style_);
-<<<<<<< HEAD
selection_style.foreground = selection_color_;
-=======
- selection_style.foreground = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextfieldSelectionColor);
->>>>>>> ui: Move NativeTheme files into ui/base/native_theme/ directory.
selection_style.range = ui::Range(selection().GetMin(),
selection().GetMax());
ApplyStyleRangeImpl(style_ranges, selection_style);
@@ -758,13 +752,7 @@ void RenderText::ApplyCompositionAndSelectionStyles(
// http://crbug.com/110109
if (!insert_mode_ && cursor_visible() && focused()) {
StyleRange replacement_mode_style(default_style_);
-<<<<<<< HEAD
replacement_mode_style.foreground = selection_color_;
-=======
- replacement_mode_style.foreground =
- ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextfieldSelectionColor);
->>>>>>> ui: Move NativeTheme files into ui/base/native_theme/ directory.
size_t cursor = cursor_position();
replacement_mode_style.range.set_start(cursor);
replacement_mode_style.range.set_end(
@@ -962,17 +950,9 @@ void RenderText::UpdateCachedBoundsAndOffset() {
}
void RenderText::DrawSelection(Canvas* canvas) {
-<<<<<<< HEAD
const SkColor color = focused() ? selection_background_focused_color_ :
selection_background_unfocused_color_;
const std::vector<Rect> sel = GetSubstringBounds(selection());
-=======
- std::vector<Rect> sel = GetSubstringBounds(selection());
- ui::NativeTheme::ColorId color_id = focused() ?
- ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused :
- ui::NativeTheme::kColorId_TextfieldSelectionBackgroundUnfocused;
- SkColor color = ui::NativeTheme::instance()->GetSystemColor(color_id);
->>>>>>> ui: Move NativeTheme files into ui/base/native_theme/ directory.
for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
canvas->FillRect(*i, color);
}
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 0004cb3..ed5b79a 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -212,18 +212,6 @@
'base/models/tree_model.h',
'base/models/tree_node_iterator.h',
'base/models/tree_node_model.h',
- 'base/native_theme/native_theme.cc',
- 'base/native_theme/native_theme.h',
- 'base/native_theme/native_theme_android.cc',
- 'base/native_theme/native_theme_android.h',
- 'base/native_theme/native_theme_aura.cc',
- 'base/native_theme/native_theme_aura.h',
- 'base/native_theme/native_theme_base.cc',
- 'base/native_theme/native_theme_base.h',
- 'base/native_theme/native_theme_gtk.cc',
- 'base/native_theme/native_theme_gtk.h',
- 'base/native_theme/native_theme_win.cc',
- 'base/native_theme/native_theme_win.h',
'base/range/range.cc',
'base/range/range.h',
'base/range/range_mac.mm',
@@ -344,6 +332,18 @@
'gfx/mac/scoped_ns_disable_screen_updates.h',
'gfx/monitor.cc',
'gfx/monitor.h',
+ 'gfx/native_theme.cc',
+ 'gfx/native_theme.h',
+ 'gfx/native_theme_android.cc',
+ 'gfx/native_theme_android.h',
+ 'gfx/native_theme_aura.cc',
+ 'gfx/native_theme_aura.h',
+ 'gfx/native_theme_base.cc',
+ 'gfx/native_theme_base.h',
+ 'gfx/native_theme_gtk.cc',
+ 'gfx/native_theme_gtk.h',
+ 'gfx/native_theme_win.cc',
+ 'gfx/native_theme_win.h',
'gfx/native_widget_types.h',
'gfx/pango_util.h',
'gfx/pango_util.cc',
@@ -452,8 +452,8 @@
],
}, { # use_aura!=1
'sources!': [
- 'base/native_theme/native_theme_aura.cc',
- 'base/native_theme/native_theme_aura.h',
+ 'gfx/native_theme_aura.cc',
+ 'gfx/native_theme_aura.h',
'base/cursor/cursor.cc',
'base/cursor/cursor.h',
'base/cursor/cursor_win.cc',
@@ -464,8 +464,8 @@
'sources/': [
['exclude', 'base/dragdrop/os_exchange_data_provider_win.cc'],
['exclude', 'base/dragdrop/os_exchange_data_provider_win.h'],
- ['exclude', 'base/native_theme/native_theme_win.cc'],
- ['exclude', 'base/native_theme/native_theme_win.h'],
+ ['exclude', 'gfx/native_theme_win.cc'],
+ ['exclude', 'gfx/native_theme_win.h'],
['exclude', 'gfx/path_win.cc'],
],
}],
@@ -534,18 +534,18 @@
],
}, { # toolkit_uses_gtk != 1
'sources!': [
- 'base/native_theme/native_theme_gtk.cc',
- 'base/native_theme/native_theme_gtk.h',
+ 'gfx/native_theme_gtk.cc',
+ 'gfx/native_theme_gtk.h',
]
}],
['OS=="win"', {
'sources': [
- 'base/native_theme/native_theme_win.cc',
- 'base/native_theme/native_theme_win.h',
'gfx/gdi_util.cc',
'gfx/gdi_util.h',
'gfx/icon_util.cc',
'gfx/icon_util.h',
+ 'gfx/native_theme_win.cc',
+ 'gfx/native_theme_win.h',
],
'sources!': [
'base/touch/touch_factory.cc',
@@ -594,8 +594,8 @@
'base/dragdrop/drop_target.cc',
'base/dragdrop/drop_target.h',
'base/dragdrop/os_exchange_data.cc',
- 'base/native_theme/native_theme_win.cc',
- 'base/native_theme/native_theme_win.h',
+ 'gfx/native_theme_win.cc',
+ 'gfx/native_theme_win.h',
],
'sources/': [
['exclude', '^base/win/*'],
diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi
index 2a0a121..0f6d293 100644
--- a/ui/ui_unittests.gypi
+++ b/ui/ui_unittests.gypi
@@ -111,9 +111,9 @@
['OS == "win"', {
'sources': [
'base/dragdrop/os_exchange_data_win_unittest.cc',
- 'base/native_theme/native_theme_win_unittest.cc',
'base/win/hwnd_subclass_unittest.cc',
'gfx/icon_util_unittest.cc',
+ 'gfx/native_theme_win_unittest.cc',
'gfx/platform_font_win_unittest.cc',
],
'include_dirs': [
@@ -199,9 +199,9 @@
}],
['use_aura==1', {
'sources!': [
- 'base/dragdrop/os_exchange_data_win_unittest.cc',
- 'base/native_theme/native_theme_win_unittest.cc',
'gfx/screen_unittest.cc',
+ 'gfx/native_theme_win_unittest.cc',
+ 'base/dragdrop/os_exchange_data_win_unittest.cc',
],
}],
['use_aura==1 or toolkit_views==1', {
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index cfedcce..8e85a2d 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -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 @@ void Checkbox::SetChecked(bool checked) {
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 @@ void Checkbox::NotifyClick(const views::Event& event) {
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 @@ gfx::Rect Checkbox::GetThemePaintRect() const {
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;
}
diff --git a/ui/views/controls/button/checkbox.h b/ui/views/controls/button/checkbox.h
index 7554cfd..b86c7c6 100644
--- a/ui/views/controls/button/checkbox.h
+++ b/ui/views/controls/button/checkbox.h
@@ -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.
@@ -43,10 +43,10 @@ class VIEWS_EXPORT Checkbox : public TextButtonBase {
virtual void NotifyClick(const views::Event& event) OVERRIDE;
// Overridden from TextButtonBase:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
virtual void GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual gfx::Rect GetTextBounds() const OVERRIDE;
// True if the checkbox is checked.
diff --git a/ui/views/controls/button/radio_button.cc b/ui/views/controls/button/radio_button.cc
index 5218bcf..1c3352cd 100644
--- a/ui/views/controls/button/radio_button.cc
+++ b/ui/views/controls/button/radio_button.cc
@@ -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.
@@ -97,8 +97,8 @@ void RadioButton::NotifyClick(const views::Event& event) {
TextButtonBase::NotifyClick(event);
}
-ui::NativeTheme::Part RadioButton::GetThemePart() const {
- return ui::NativeTheme::kRadio;
+gfx::NativeTheme::Part RadioButton::GetThemePart() const {
+ return gfx::NativeTheme::kRadio;
}
} // namespace views
diff --git a/ui/views/controls/button/radio_button.h b/ui/views/controls/button/radio_button.h
index 2fa9a97..19ef602 100644
--- a/ui/views/controls/button/radio_button.h
+++ b/ui/views/controls/button/radio_button.h
@@ -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.
@@ -32,7 +32,7 @@ class VIEWS_EXPORT RadioButton : public Checkbox {
virtual void NotifyClick(const views::Event& event) OVERRIDE;
// Overridden from TextButtonBase:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
// Overridden from Checkbox:
virtual void SetChecked(bool checked) OVERRIDE;
diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc
index 1e616da..89aa97d 100644
--- a/ui/views/controls/button/text_button.cc
+++ b/ui/views/controls/button/text_button.cc
@@ -18,7 +18,7 @@
#if defined(OS_WIN)
#include "skia/ext/skia_utils_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/gfx/platform_font_win.h"
#endif
@@ -208,30 +208,30 @@ TextButtonNativeThemeBorder::~TextButtonNativeThemeBorder() {
void TextButtonNativeThemeBorder::Paint(const View& view,
gfx::Canvas* canvas) const {
const TextButtonBase* tb = static_cast<const TextButton*>(&view);
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- ui::NativeTheme::Part part = delegate_->GetThemePart();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ gfx::NativeTheme::Part part = delegate_->GetThemePart();
gfx::Rect rect(delegate_->GetThemePaintRect());
if (tb->show_multiple_icon_states() &&
delegate_->GetThemeAnimation() != NULL &&
delegate_->GetThemeAnimation()->is_animating()) {
// Paint background state.
- ui::NativeTheme::ExtraParams prev_extra;
- ui::NativeTheme::State prev_state =
+ gfx::NativeTheme::ExtraParams prev_extra;
+ gfx::NativeTheme::State prev_state =
delegate_->GetBackgroundThemeState(&prev_extra);
native_theme->Paint(canvas->sk_canvas(), part, prev_state, rect,
prev_extra);
// Composite foreground state above it.
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
int alpha = delegate_->GetThemeAnimation()->CurrentValueBetween(0, 255);
canvas->SaveLayerAlpha(static_cast<uint8>(alpha));
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
canvas->Restore();
} else {
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
}
}
@@ -252,16 +252,16 @@ TextButtonBase::TextButtonBase(ButtonListener* listener, const string16& text)
alignment_(ALIGN_LEFT),
font_(ResourceBundle::GetSharedInstance().GetFont(
ResourceBundle::BaseFont)),
- color_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_enabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_disabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonDisabledColor)),
- color_highlight_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHighlightColor)),
- color_hover_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHoverColor)),
+ color_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonEnabledColor)),
+ color_enabled_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonEnabledColor)),
+ color_disabled_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonDisabledColor)),
+ color_highlight_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonHighlightColor)),
+ color_hover_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonHoverColor)),
text_halo_color_(0),
has_text_halo_(false),
active_text_shadow_color_(0),
@@ -458,15 +458,15 @@ int TextButtonBase::ComputeCanvasStringFlags() const {
}
void TextButtonBase::GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const {
+ gfx::NativeTheme::ExtraParams* params) const {
params->button.checked = false;
params->button.indeterminate = false;
params->button.is_default = false;
params->button.has_border = false;
params->button.classic_state = 0;
params->button.background_color =
- ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonBackgroundColor);
+ gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonBackgroundColor);
}
gfx::Rect TextButtonBase::GetContentBounds(int extra_width) const {
@@ -608,21 +608,21 @@ gfx::Rect TextButtonBase::GetThemePaintRect() const {
return GetLocalBounds();
}
-ui::NativeTheme::State TextButtonBase::GetThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
switch(state()) {
case BS_DISABLED:
- return ui::NativeTheme::kDisabled;
+ return gfx::NativeTheme::kDisabled;
case BS_NORMAL:
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
case BS_HOT:
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
case BS_PUSHED:
- return ui::NativeTheme::kPressed;
+ return gfx::NativeTheme::kPressed;
default:
NOTREACHED() << "Unknown state: " << state();
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
}
@@ -630,23 +630,23 @@ const ui::Animation* TextButtonBase::GetThemeAnimation() const {
#if defined(USE_AURA)
return hover_animation_.get();
#elif defined(OS_WIN)
- return ui::NativeThemeWin::instance()->IsThemingActive()
+ return gfx::NativeThemeWin::instance()->IsThemingActive()
? hover_animation_.get() : NULL;
#else
return hover_animation_.get();
#endif
}
-ui::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
-ui::NativeTheme::State TextButtonBase::GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
}
////////////////////////////////////////////////////////////////////////////////
@@ -756,11 +756,11 @@ void TextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
}
}
-ui::NativeTheme::Part TextButton::GetThemePart() const {
- return ui::NativeTheme::kPushButton;
+gfx::NativeTheme::Part TextButton::GetThemePart() const {
+ return gfx::NativeTheme::kPushButton;
}
-void TextButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
+void TextButton::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
TextButtonBase::GetExtraParams(params);
params->button.is_default = is_default_;
}
@@ -848,7 +848,7 @@ void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
}
void NativeTextButton::GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const {
+ gfx::NativeTheme::ExtraParams* params) const {
TextButton::GetExtraParams(params);
params->button.has_border = true;
}
diff --git a/ui/views/controls/button/text_button.h b/ui/views/controls/button/text_button.h
index 2dd1cb8..2e1f285 100644
--- a/ui/views/controls/button/text_button.h
+++ b/ui/views/controls/button/text_button.h
@@ -225,15 +225,15 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton,
// Overridden from NativeThemeDelegate:
virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
- virtual ui::NativeTheme::State GetThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual const ui::Animation* GetThemeAnimation() const OVERRIDE;
- virtual ui::NativeTheme::State GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
- virtual ui::NativeTheme::State GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
- virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const;
+ virtual void GetExtraParams(gfx::NativeTheme::ExtraParams* params) const;
virtual gfx::Rect GetTextBounds() const;
@@ -353,11 +353,11 @@ class VIEWS_EXPORT TextButton : public TextButtonBase {
virtual const SkBitmap& GetImageToPaint() const;
// Overridden from NativeThemeDelegate:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
// Overridden from TextButtonBase:
virtual void GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual gfx::Rect GetTextBounds() const OVERRIDE;
private:
@@ -413,7 +413,7 @@ class VIEWS_EXPORT NativeTextButton : public TextButton {
// Overridden from TextButton:
virtual void GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(NativeTextButton);
};
diff --git a/ui/views/controls/combobox/native_combobox_win.cc b/ui/views/controls/combobox/native_combobox_win.cc
index 21c11c2..fbf7adf 100644
--- a/ui/views/controls/combobox/native_combobox_win.cc
+++ b/ui/views/controls/combobox/native_combobox_win.cc
@@ -7,10 +7,10 @@
#include "base/i18n/rtl.h"
#include "base/utf_string_conversions.h"
#include "ui/base/models/combobox_model.h"
-#include "ui/base/native_theme/native_theme_win.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/combobox/native_combobox_views.h"
#include "ui/views/widget/widget.h"
@@ -109,8 +109,8 @@ gfx::Size NativeComboboxWin::GetPreferredSize() {
GetComboBoxInfo(native_view(), &cbi);
gfx::Rect rect_item(cbi.rcItem);
gfx::Rect rect_button(cbi.rcButton);
- gfx::Size border = ui::NativeThemeWin::instance()->GetThemeBorderSize(
- ui::NativeThemeWin::MENULIST);
+ gfx::Size border = gfx::NativeThemeWin::instance()->GetThemeBorderSize(
+ gfx::NativeThemeWin::MENULIST);
// The padding value of '3' is the xy offset from the corner of the control
// to the corner of rcItem. It does not seem to be queryable from the theme.
diff --git a/ui/views/controls/focusable_border.cc b/ui/views/controls/focusable_border.cc
index c603df9..6cdd1c3 100644
--- a/ui/views/controls/focusable_border.cc
+++ b/ui/views/controls/focusable_border.cc
@@ -4,9 +4,9 @@
#include "ui/views/controls/focusable_border.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/insets.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/skia_util.h"
namespace {
@@ -32,9 +32,9 @@ void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) const {
path.addRect(gfx::RectToSkRect(view.GetLocalBounds()), SkPath::kCW_Direction);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
- SkColor focus_color = ui::NativeTheme::instance()->GetSystemColor(
- has_focus_ ? ui::NativeTheme::kColorId_FocusedBorderColor
- : ui::NativeTheme::kColorId_UnfocusedBorderColor);
+ SkColor focus_color = gfx::NativeTheme::instance()->GetSystemColor(
+ has_focus_ ? gfx::NativeTheme::kColorId_FocusedBorderColor
+ : gfx::NativeTheme::kColorId_UnfocusedBorderColor);
paint.setColor(focus_color);
paint.setStrokeWidth(SkIntToScalar(2));
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index f907f9f..ac40fe5 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -15,13 +15,13 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "ui/base/accessibility/accessible_view_state.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/font.h"
#include "ui/gfx/insets.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/background.h"
namespace views {
@@ -359,12 +359,12 @@ void Label::Init(const string16& text, const gfx::Font& font) {
contains_mouse_ = false;
font_ = font;
text_size_valid_ = false;
- requested_enabled_color_ = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_LabelEnabledColor);
- requested_disabled_color_ = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_LabelDisabledColor);
- background_color_ = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_LabelBackgroundColor);
+ requested_enabled_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelEnabledColor);
+ requested_disabled_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelDisabledColor);
+ background_color_ = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_LabelBackgroundColor);
auto_color_readability_ = true;
RecalculateColors();
horiz_alignment_ = ALIGN_CENTER;
diff --git a/ui/views/controls/menu/menu_config_views.cc b/ui/views/controls/menu/menu_config_views.cc
index 88edb10..0142240 100644
--- a/ui/views/controls/menu/menu_config_views.cc
+++ b/ui/views/controls/menu/menu_config_views.cc
@@ -6,17 +6,17 @@
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/base/native_theme/native_theme_aura.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/native_theme_aura.h"
namespace views {
// static
MenuConfig* MenuConfig::Create() {
MenuConfig* config = new MenuConfig();
- config->text_color = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor);
+ config->text_color = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor);
config->submenu_horizontal_margin_size = 0;
config->submenu_vertical_margin_size = 2;
config->submenu_horizontal_inset = 1;
diff --git a/ui/views/controls/menu/menu_config_win.cc b/ui/views/controls/menu/menu_config_win.cc
index 86d4b64..07681fe 100644
--- a/ui/views/controls/menu/menu_config_win.cc
+++ b/ui/views/controls/menu/menu_config_win.cc
@@ -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.
@@ -12,10 +12,10 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/win_util.h"
#include "ui/base/l10n/l10n_util_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
+#include "ui/gfx/native_theme_win.h"
-using ui::NativeTheme;
-using ui::NativeThemeWin;
+using gfx::NativeTheme;
+using gfx::NativeThemeWin;
namespace views {
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index d07d7a4..74d458c 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -686,8 +686,8 @@ void MenuItemView::PaintAccelerator(gfx::Canvas* canvas) {
else
flags |= gfx::Canvas::TEXT_ALIGN_RIGHT;
canvas->DrawStringInt(
- accel_text, font, ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonDisabledColor),
+ accel_text, font, gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonDisabledColor),
accel_bounds.x(), accel_bounds.y(), accel_bounds.width(),
accel_bounds.height(), flags);
}
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index f61453a..dbc22f6 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -19,7 +19,7 @@
#if defined(OS_WIN)
#include <windows.h>
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
#endif
namespace gfx {
@@ -362,7 +362,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// Paints the check/radio button indicator.
void PaintCheck(gfx::Canvas* canvas,
- ui::NativeTheme::State state,
+ gfx::NativeTheme::State state,
SelectionState selection_state,
const MenuConfig& config);
#endif
diff --git a/ui/views/controls/menu/menu_item_view_views.cc b/ui/views/controls/menu/menu_item_view_views.cc
index 1253ba4..6942dc9 100644
--- a/ui/views/controls/menu/menu_item_view_views.cc
+++ b/ui/views/controls/menu/menu_item_view_views.cc
@@ -7,11 +7,11 @@
#include "base/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_image_util.h"
#include "ui/views/controls/menu/submenu_view.h"
@@ -37,8 +37,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// only need the background when we want it to look different, as when we're
// selected.
if (render_selection) {
- SkColor bg_color = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
+ SkColor bg_color = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
canvas->DrawColor(bg_color, SkXfermode::kSrc_Mode);
}
@@ -64,9 +64,9 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
}
// Render the foreground.
- SkColor fg_color = ui::NativeTheme::instance()->GetSystemColor(
- enabled() ? ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor
- : ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor);
+ SkColor fg_color = gfx::NativeTheme::instance()->GetSystemColor(
+ enabled() ? gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor
+ : gfx::NativeTheme::kColorId_DisabledMenuItemForegroundColor);
const gfx::Font& font = GetFont();
int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
diff --git a/ui/views/controls/menu/menu_item_view_win.cc b/ui/views/controls/menu/menu_item_view_win.cc
index bca528a..8458e22 100644
--- a/ui/views/controls/menu/menu_item_view_win.cc
+++ b/ui/views/controls/menu/menu_item_view_win.cc
@@ -8,12 +8,12 @@
#include <Vssym32.h>
#include "grit/ui_strings.h"
-#include "ui/base/native_theme/native_theme_win.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/submenu_view.h"
-using ui::NativeTheme;
+using gfx::NativeTheme;
namespace views {
@@ -79,8 +79,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// Render the foreground.
// Menu color is specific to Vista, fallback to classic colors if can't
// get color.
- SkColor fg_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
- ui::NativeThemeWin::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
+ SkColor fg_color = gfx::NativeThemeWin::instance()->GetThemeColorWithDefault(
+ gfx::NativeThemeWin::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
default_sys_color);
const gfx::Font& font = GetFont();
int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
@@ -124,11 +124,11 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// If our sub menus open from right to left (which is the case when the
// locale is RTL) then we should make sure the menu arrow points to the
// right direction.
- ui::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::ExtraParams extra;
extra.menu_arrow.pointing_right = !base::i18n::IsRTL();
extra.menu_arrow.is_selected = render_selection;
- ui::NativeTheme::instance()->Paint(canvas->sk_canvas(),
- ui::NativeTheme::kMenuPopupArrow, control_state, arrow_bounds, extra);
+ gfx::NativeTheme::instance()->Paint(canvas->sk_canvas(),
+ gfx::NativeTheme::kMenuPopupArrow, control_state, arrow_bounds, extra);
}
}
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc
index 5d91d6d..f8f36b8 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -11,16 +11,16 @@
#endif
#include "ui/base/accessibility/accessible_view_state.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/border.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_controller.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/submenu_view.h"
-using ui::NativeTheme;
+using gfx::NativeTheme;
// Height of the scroll arrow.
// This goes up to 4 with large fonts, but this is close enough for now.
diff --git a/ui/views/controls/menu/menu_separator_views.cc b/ui/views/controls/menu/menu_separator_views.cc
index 61ec07d..484825f 100644
--- a/ui/views/controls/menu/menu_separator_views.cc
+++ b/ui/views/controls/menu/menu_separator_views.cc
@@ -5,8 +5,8 @@
#include "ui/views/controls/menu/menu_separator.h"
#include "third_party/skia/include/core/SkColor.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/controls/menu/menu_config.h"
namespace {
@@ -19,8 +19,8 @@ namespace views {
void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
canvas->FillRect(gfx::Rect(0, height() / 2, width(), kSeparatorHeight),
- ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_MenuSeparatorColor));
+ gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_MenuSeparatorColor));
}
gfx::Size MenuSeparator::GetPreferredSize() {
diff --git a/ui/views/controls/menu/menu_separator_win.cc b/ui/views/controls/menu/menu_separator_win.cc
index edd06d5..a5769140 100644
--- a/ui/views/controls/menu/menu_separator_win.cc
+++ b/ui/views/controls/menu/menu_separator_win.cc
@@ -8,8 +8,8 @@
#include <uxtheme.h>
#include <Vssym32.h>
-#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/rect.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_item_view.h"
@@ -20,24 +20,24 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
const MenuConfig& config = MenuConfig::instance();
// The gutter is rendered before the background.
int start_x = 0;
- const ui::NativeTheme* theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* theme = gfx::NativeTheme::instance();
if (config.render_gutter) {
// If render_gutter is true, we're on Vista and need to render the
// gutter, then indent the separator from the gutter.
gfx::Rect gutter_bounds(MenuItemView::label_start() -
config.gutter_to_label - config.gutter_width, 0,
config.gutter_width, height());
- ui::NativeTheme::ExtraParams extra;
- theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kMenuPopupGutter,
- ui::NativeTheme::kNormal, gutter_bounds, extra);
+ gfx::NativeTheme::ExtraParams extra;
+ theme->Paint(canvas->sk_canvas(), gfx::NativeTheme::kMenuPopupGutter,
+ gfx::NativeTheme::kNormal, gutter_bounds, extra);
start_x = gutter_bounds.x() + config.gutter_width;
}
gfx::Rect separator_bounds(start_x, 0, width(), height());
- ui::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::ExtraParams extra;
extra.menu_separator.has_gutter = config.render_gutter;
- theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
- ui::NativeTheme::kNormal, separator_bounds, extra);
+ theme->Paint(canvas->sk_canvas(), gfx::NativeTheme::kMenuPopupSeparator,
+ gfx::NativeTheme::kNormal, separator_bounds, extra);
}
gfx::Size MenuSeparator::GetPreferredSize() {
diff --git a/ui/views/controls/menu/native_menu_win.cc b/ui/views/controls/menu/native_menu_win.cc
index bb23b09..ba60cab 100644
--- a/ui/views/controls/menu/native_menu_win.cc
+++ b/ui/views/controls/menu/native_menu_win.cc
@@ -18,16 +18,16 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/models/menu_model.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/rect.h"
#include "ui/views/controls/menu/menu_2.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_listener.h"
-using ui::NativeTheme;
+using gfx::NativeTheme;
namespace views {
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.cc b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
index 0d61986..7eb2a08 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc
@@ -41,9 +41,9 @@ class ScrollBarButton : public BaseScrollBarButton {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
private:
- ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
- ui::NativeTheme::Part GetNativeThemePart() const;
- ui::NativeTheme::State GetNativeThemeState() const;
+ gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ gfx::NativeTheme::Part GetNativeThemePart() const;
+ gfx::NativeTheme::State GetNativeThemeState() const;
Type type_;
};
@@ -63,9 +63,9 @@ class ScrollBarThumb : public BaseScrollBarThumb {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
private:
- ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
- ui::NativeTheme::Part GetNativeThemePart() const;
- ui::NativeTheme::State GetNativeThemeState() const;
+ gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ gfx::NativeTheme::Part GetNativeThemePart() const;
+ gfx::NativeTheme::State GetNativeThemeState() const;
ScrollBar* scroll_bar_;
};
@@ -86,21 +86,22 @@ ScrollBarButton::~ScrollBarButton() {
}
gfx::Size ScrollBarButton::GetPreferredSize() {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarButton::OnPaint(gfx::Canvas* canvas) {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
gfx::Rect bounds(GetPreferredSize());
native_theme->Paint(canvas->sk_canvas(), GetNativeThemePart(),
GetNativeThemeState(), bounds, GetNativeThemeParams());
}
-ui::NativeTheme::ExtraParams ScrollBarButton::GetNativeThemeParams() const {
- ui::NativeTheme::ExtraParams params;
+gfx::NativeTheme::ExtraParams
+ ScrollBarButton::GetNativeThemeParams() const {
+ gfx::NativeTheme::ExtraParams params;
switch (state_) {
case CustomButton::BS_HOT:
@@ -114,37 +115,39 @@ ui::NativeTheme::ExtraParams ScrollBarButton::GetNativeThemeParams() const {
return params;
}
-ui::NativeTheme::Part ScrollBarButton::GetNativeThemePart() const {
+gfx::NativeTheme::Part
+ ScrollBarButton::GetNativeThemePart() const {
switch (type_) {
case UP:
- return ui::NativeTheme::kScrollbarUpArrow;
+ return gfx::NativeTheme::kScrollbarUpArrow;
case DOWN:
- return ui::NativeTheme::kScrollbarDownArrow;
+ return gfx::NativeTheme::kScrollbarDownArrow;
case LEFT:
- return ui::NativeTheme::kScrollbarLeftArrow;
+ return gfx::NativeTheme::kScrollbarLeftArrow;
case RIGHT:
- return ui::NativeTheme::kScrollbarRightArrow;
+ return gfx::NativeTheme::kScrollbarRightArrow;
default:
- return ui::NativeTheme::kScrollbarUpArrow;
+ return gfx::NativeTheme::kScrollbarUpArrow;
}
}
-ui::NativeTheme::State ScrollBarButton::GetNativeThemeState() const {
- ui::NativeTheme::State state;
+gfx::NativeTheme::State
+ ScrollBarButton::GetNativeThemeState() const {
+ gfx::NativeTheme::State state;
switch (state_) {
case CustomButton::BS_HOT:
- state = ui::NativeTheme::kHovered;
+ state = gfx::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = ui::NativeTheme::kPressed;
+ state = gfx::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = ui::NativeTheme::kDisabled;
+ state = gfx::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = ui::NativeTheme::kNormal;
+ state = gfx::NativeTheme::kNormal;
break;
}
@@ -165,14 +168,14 @@ ScrollBarThumb::~ScrollBarThumb() {
}
gfx::Size ScrollBarThumb::GetPreferredSize() {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
native_theme->Paint(canvas->sk_canvas(),
GetNativeThemePart(),
@@ -181,8 +184,9 @@ void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
GetNativeThemeParams());
}
-ui::NativeTheme::ExtraParams ScrollBarThumb::GetNativeThemeParams() const {
- ui::NativeTheme::ExtraParams params;
+gfx::NativeTheme::ExtraParams
+ ScrollBarThumb::GetNativeThemeParams() const {
+ gfx::NativeTheme::ExtraParams params;
switch (GetState()) {
case CustomButton::BS_HOT:
@@ -196,28 +200,28 @@ ui::NativeTheme::ExtraParams ScrollBarThumb::GetNativeThemeParams() const {
return params;
}
-ui::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
+gfx::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
if (scroll_bar_->IsHorizontal())
- return ui::NativeTheme::kScrollbarHorizontalThumb;
- return ui::NativeTheme::kScrollbarVerticalThumb;
+ return gfx::NativeTheme::kScrollbarHorizontalThumb;
+ return gfx::NativeTheme::kScrollbarVerticalThumb;
}
-ui::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
- ui::NativeTheme::State state;
+gfx::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
+ gfx::NativeTheme::State state;
switch (GetState()) {
case CustomButton::BS_HOT:
- state = ui::NativeTheme::kHovered;
+ state = gfx::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = ui::NativeTheme::kPressed;
+ state = gfx::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = ui::NativeTheme::kDisabled;
+ state = gfx::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = ui::NativeTheme::kNormal;
+ state = gfx::NativeTheme::kNormal;
break;
}
@@ -242,15 +246,15 @@ NativeScrollBarViews::NativeScrollBarViews(NativeScrollBar* scroll_bar)
prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT);
next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT);
- part_ = ui::NativeTheme::kScrollbarHorizontalTrack;
+ part_ = gfx::NativeTheme::kScrollbarHorizontalTrack;
} else {
prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP);
next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN);
- part_ = ui::NativeTheme::kScrollbarVerticalTrack;
+ part_ = gfx::NativeTheme::kScrollbarVerticalTrack;
}
- state_ = ui::NativeTheme::kNormal;
+ state_ = gfx::NativeTheme::kNormal;
AddChildView(prev_button_);
AddChildView(next_button_);
@@ -281,7 +285,7 @@ void NativeScrollBarViews::Layout() {
}
void NativeScrollBarViews::OnPaint(gfx::Canvas* canvas) {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
gfx::Rect bounds = GetTrackBounds();
if (bounds.IsEmpty())
@@ -382,20 +386,20 @@ NativeScrollBarWrapper* NativeScrollBarWrapper::CreateWrapper(
// static
int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
- ui::NativeTheme::ExtraParams button_params;
+ gfx::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- ui::NativeTheme::kScrollbarLeftArrow,
- ui::NativeTheme::kNormal,
+ gfx::NativeTheme::kScrollbarLeftArrow,
+ gfx::NativeTheme::kNormal,
button_params);
- ui::NativeTheme::ExtraParams thumb_params;
+ gfx::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- ui::NativeTheme::kScrollbarHorizontalThumb,
- ui::NativeTheme::kNormal,
+ gfx::NativeTheme::kScrollbarHorizontalThumb,
+ gfx::NativeTheme::kNormal,
thumb_params);
return std::max(track_size.height(), button_size.height());
@@ -403,20 +407,20 @@ int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
// static
int NativeScrollBarWrapper::GetVerticalScrollBarWidth() {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
- ui::NativeTheme::ExtraParams button_params;
+ gfx::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- ui::NativeTheme::kScrollbarUpArrow,
- ui::NativeTheme::kNormal,
+ gfx::NativeTheme::kScrollbarUpArrow,
+ gfx::NativeTheme::kNormal,
button_params);
- ui::NativeTheme::ExtraParams thumb_params;
+ gfx::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- ui::NativeTheme::kScrollbarVerticalThumb,
- ui::NativeTheme::kNormal,
+ gfx::NativeTheme::kScrollbarVerticalThumb,
+ gfx::NativeTheme::kNormal,
thumb_params);
return std::max(track_size.width(), button_size.width());
diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.h b/ui/views/controls/scrollbar/native_scroll_bar_views.h
index 0335e7f..136338c 100644
--- a/ui/views/controls/scrollbar/native_scroll_bar_views.h
+++ b/ui/views/controls/scrollbar/native_scroll_bar_views.h
@@ -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.
@@ -7,7 +7,7 @@
#pragma once
#include "base/compiler_specific.h"
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/point.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/scrollbar/base_scroll_bar.h"
@@ -69,9 +69,9 @@ class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar,
Button* prev_button_;
Button* next_button_;
- ui::NativeTheme::ExtraParams params_;
- ui::NativeTheme::Part part_;
- ui::NativeTheme::State state_;
+ gfx::NativeTheme::ExtraParams params_;
+ gfx::NativeTheme::Part part_;
+ gfx::NativeTheme::State state_;
DISALLOW_COPY_AND_ASSIGN(NativeScrollBarViews);
};
diff --git a/ui/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/ui/views/controls/tabbed_pane/native_tabbed_pane_win.cc
index 8b66e91..f6924ef3 100644
--- a/ui/views/controls/tabbed_pane/native_tabbed_pane_win.cc
+++ b/ui/views/controls/tabbed_pane/native_tabbed_pane_win.cc
@@ -9,11 +9,11 @@
#include "base/logging.h"
#include "base/stl_util.h"
#include "ui/base/l10n/l10n_util_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/views/controls/tabbed_pane/tabbed_pane.h"
#include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "ui/views/layout/fill_layout.h"
@@ -30,8 +30,8 @@ class TabBackground : public Background {
// TMT_FILLCOLORHINT returns a color value that supposedly
// approximates the texture drawn by PaintTabPanelBackground.
SkColor tab_page_color =
- ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
- ui::NativeThemeWin::TAB, TABP_BODY, 0, TMT_FILLCOLORHINT,
+ gfx::NativeThemeWin::instance()->GetThemeColorWithDefault(
+ gfx::NativeThemeWin::TAB, TABP_BODY, 0, TMT_FILLCOLORHINT,
COLOR_3DFACE);
SetNativeControlColor(tab_page_color);
}
@@ -39,10 +39,10 @@ class TabBackground : public Background {
virtual void Paint(gfx::Canvas* canvas, View* view) const {
gfx::Rect r(0, 0, view->width(), view->height());
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::instance()->Paint(
- canvas->sk_canvas(), ui::NativeTheme::kTabPanelBackground,
- ui::NativeTheme::kNormal, r, extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::instance()->Paint(
+ canvas->sk_canvas(), gfx::NativeTheme::kTabPanelBackground,
+ gfx::NativeTheme::kNormal, r, extra);
}
private:
diff --git a/ui/views/controls/table/table_view_views.cc b/ui/views/controls/table/table_view_views.cc
index 69bd813..161d21c 100644
--- a/ui/views/controls/table/table_view_views.cc
+++ b/ui/views/controls/table/table_view_views.cc
@@ -7,8 +7,8 @@
#include "base/i18n/rtl.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/models/table_model.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/border.h"
#include "ui/views/controls/scroll_view.h"
@@ -73,8 +73,8 @@ View* TableView::CreateParentIfNecessary() {
ScrollView* scroll_view = new ScrollView;
scroll_view->SetContents(this);
scroll_view->set_border(Border::CreateSolidBorder(
- 1, ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_UnfocusedBorderColor)));
+ 1, gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_UnfocusedBorderColor)));
return scroll_view;
}
diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc
index 81ef1eb..f037923 100644
--- a/ui/views/controls/textfield/native_textfield_win.cc
+++ b/ui/views/controls/textfield/native_textfield_win.cc
@@ -20,9 +20,9 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
#include "ui/base/range/range.h"
#include "ui/base/win/mouse_wheel_util.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
@@ -920,9 +920,9 @@ void NativeTextfieldWin::OnNCPaint(HRGN region) {
int classic_state =
(!textfield_->enabled() || textfield_->read_only()) ? DFCS_INACTIVE : 0;
- ui::NativeThemeWin::instance()->PaintTextField(hdc, part, state,
- classic_state, &window_rect,
- bg_color_, false, true);
+ gfx::NativeThemeWin::instance()->PaintTextField(hdc, part, state,
+ classic_state, &window_rect,
+ bg_color_, false, true);
// NOTE: I tried checking the transparent property of the theme and invoking
// drawParentBackground, but it didn't seem to make a difference.
diff --git a/ui/views/controls/textfield/textfield_views_model.cc b/ui/views/controls/textfield/textfield_views_model.cc
index d707166..a931a16 100644
--- a/ui/views/controls/textfield/textfield_views_model.cc
+++ b/ui/views/controls/textfield/textfield_views_model.cc
@@ -12,11 +12,11 @@
#include "base/utf_string_conversions.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/range/range.h"
#include "ui/base/text/utf16_indexing.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/render_text.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/views_delegate.h"
diff --git a/ui/views/controls/tree/tree_view_views.cc b/ui/views/controls/tree/tree_view_views.cc
index 94893d1..92a6c2b 100644
--- a/ui/views/controls/tree/tree_view_views.cc
+++ b/ui/views/controls/tree/tree_view_views.cc
@@ -11,10 +11,10 @@
#include "grit/ui_resources.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/keycodes/keyboard_codes.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
@@ -81,8 +81,8 @@ View* TreeView::CreateParentIfNecessary() {
ScrollView* scroll_view = new ScrollView;
scroll_view->SetContents(this);
scroll_view->set_border(Border::CreateSolidBorder(
- 1, ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_UnfocusedBorderColor)));
+ 1, gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_UnfocusedBorderColor)));
return scroll_view;
}
diff --git a/ui/views/examples/native_theme_button_example.cc b/ui/views/examples/native_theme_button_example.cc
index 86e8ab7..c8a5e59 100644
--- a/ui/views/examples/native_theme_button_example.cc
+++ b/ui/views/examples/native_theme_button_example.cc
@@ -63,14 +63,14 @@ ExampleNativeThemeButton::~ExampleNativeThemeButton() {
std::string ExampleNativeThemeButton::MessWithState() {
const char* message = NULL;
switch (GetThemePart()) {
- case ui::NativeTheme::kPushButton:
+ case gfx::NativeTheme::kPushButton:
message = "Pressed! count:%d";
break;
- case ui::NativeTheme::kRadio:
+ case gfx::NativeTheme::kRadio:
is_checked_ = !is_checked_;
message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d";
break;
- case ui::NativeTheme::kCheckbox:
+ case gfx::NativeTheme::kCheckbox:
if (is_indeterminate_) {
is_checked_ = false;
is_indeterminate_ = false;
@@ -98,45 +98,46 @@ void ExampleNativeThemeButton::OnSelectedIndexChanged(Combobox* combobox) {
SchedulePaint();
}
-ui::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
+gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
switch (cb_part_->selected_index()) {
case 0:
- return ui::NativeTheme::kPushButton;
+ return gfx::NativeTheme::kPushButton;
case 1:
- return ui::NativeTheme::kRadio;
+ return gfx::NativeTheme::kRadio;
case 2:
- return ui::NativeTheme::kCheckbox;
+ return gfx::NativeTheme::kCheckbox;
default:
NOTREACHED();
}
- return ui::NativeTheme::kPushButton;
+ return gfx::NativeTheme::kPushButton;
}
gfx::Rect ExampleNativeThemeButton::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::Rect rect(size);
rect.set_x(GetMirroredXForRect(rect));
return rect;
}
-ui::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
int selected = cb_state_->selected_index();
if (selected > 3) {
switch (state()) {
case BS_DISABLED:
- return ui::NativeTheme::kDisabled;
+ return gfx::NativeTheme::kDisabled;
case BS_NORMAL:
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
case BS_HOT:
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
case BS_PUSHED:
- return ui::NativeTheme::kPressed;
+ return gfx::NativeTheme::kPressed;
default:
NOTREACHED();
}
@@ -144,21 +145,21 @@ ui::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
switch (selected) {
case 0:
- return ui::NativeTheme::kDisabled;
+ return gfx::NativeTheme::kDisabled;
case 1:
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
case 2:
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
case 3:
- return ui::NativeTheme::kPressed;
+ return gfx::NativeTheme::kPressed;
default:
NOTREACHED();
}
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
void ExampleNativeThemeButton::GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const {
+ gfx::NativeTheme::ExtraParams* params) const {
params->button.checked = is_checked_;
params->button.indeterminate = is_indeterminate_;
@@ -172,16 +173,16 @@ const ui::Animation* ExampleNativeThemeButton::GetThemeAnimation() const {
return cb_state_->selected_index() <= 3 ? NULL : hover_animation_.get();
}
-ui::NativeTheme::State ExampleNativeThemeButton::GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State ExampleNativeThemeButton::GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
-ui::NativeTheme::State ExampleNativeThemeButton::GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State ExampleNativeThemeButton::GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
}
gfx::Size ExampleNativeThemeButton::GetPreferredSize() {
diff --git a/ui/views/examples/native_theme_button_example.h b/ui/views/examples/native_theme_button_example.h
index 2bc940c..e77038e 100644
--- a/ui/views/examples/native_theme_button_example.h
+++ b/ui/views/examples/native_theme_button_example.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/controls/button/custom_button.h"
#include "ui/views/controls/combobox/combobox_listener.h"
#include "ui/views/examples/example_base.h"
@@ -45,17 +45,17 @@ class ExampleNativeThemeButton : public CustomButton,
virtual void OnSelectedIndexChanged(Combobox* combobox) OVERRIDE;
// Overridden from NativeThemeDelegate:
- virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
- virtual ui::NativeTheme::State GetThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual const ui::Animation* GetThemeAnimation() const OVERRIDE;
- virtual ui::NativeTheme::State GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
- virtual ui::NativeTheme::State GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual gfx::NativeTheme::State GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
- void GetExtraParams(ui::NativeTheme::ExtraParams* params) const;
+ void GetExtraParams(gfx::NativeTheme::ExtraParams* params) const;
scoped_ptr<NativeThemePainter> painter_;
Combobox* cb_part_;
diff --git a/ui/views/examples/native_theme_checkbox_example.h b/ui/views/examples/native_theme_checkbox_example.h
index f7c3858..6ff0869 100644
--- a/ui/views/examples/native_theme_checkbox_example.h
+++ b/ui/views/examples/native_theme_checkbox_example.h
@@ -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.
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/examples/example_base.h"
diff --git a/ui/views/native_theme_delegate.h b/ui/views/native_theme_delegate.h
index 9f2945d..bd6051e 100644
--- a/ui/views/native_theme_delegate.h
+++ b/ui/views/native_theme_delegate.h
@@ -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.
@@ -6,7 +6,7 @@
#define UI_VIEWS_NATIVE_THEME_DELEGATE_H_
#pragma once
-#include "ui/base/native_theme/native_theme.h"
+#include "ui/gfx/native_theme.h"
#include "ui/gfx/rect.h"
#include "ui/views/views_export.h"
@@ -24,28 +24,28 @@ class VIEWS_EXPORT NativeThemeDelegate {
virtual ~NativeThemeDelegate() {}
// Get the native theme part that should be drawn.
- virtual ui::NativeTheme::Part GetThemePart() const = 0;
+ virtual gfx::NativeTheme::Part GetThemePart() const = 0;
// Get the rectangle that should be painted.
virtual gfx::Rect GetThemePaintRect() const = 0;
// Get the state of the part, along with any extra data needed for drawing.
- virtual ui::NativeTheme::State GetThemeState(
- ui::NativeTheme::ExtraParams* params) const = 0;
+ virtual gfx::NativeTheme::State GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const = 0;
// If the native theme drawign should be animated, return the Animation object
// that controlls it. If no animation is ongoing, NULL may be returned.
virtual const ui::Animation* GetThemeAnimation() const = 0;
// If animation is onging, this returns the background native theme state.
- virtual ui::NativeTheme::State GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const = 0;
+ virtual gfx::NativeTheme::State GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const = 0;
// If animation is onging, this returns the foreground native theme state.
// This state will be composited over the background using an alpha value
// based on the current value of the animation.
- virtual ui::NativeTheme::State GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const = 0;
+ virtual gfx::NativeTheme::State GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const = 0;
};
} // namespace views
diff --git a/ui/views/native_theme_painter.cc b/ui/views/native_theme_painter.cc
index 8acb532..454ed3d 100644
--- a/ui/views/native_theme_painter.cc
+++ b/ui/views/native_theme_painter.cc
@@ -18,36 +18,36 @@ NativeThemePainter::NativeThemePainter(NativeThemeDelegate* delegate)
}
gfx::Size NativeThemePainter::GetPreferredSize() {
- const ui::NativeTheme* theme = ui::NativeTheme::instance();
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ const gfx::NativeTheme* theme = gfx::NativeTheme::instance();
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
return theme->GetPartSize(delegate_->GetThemePart(), state, extra);
}
void NativeThemePainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- ui::NativeTheme::Part part = delegate_->GetThemePart();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ gfx::NativeTheme::Part part = delegate_->GetThemePart();
gfx::Rect rect(size);
if (delegate_->GetThemeAnimation() != NULL &&
delegate_->GetThemeAnimation()->is_animating()) {
// Paint background state.
- ui::NativeTheme::ExtraParams prev_extra;
- ui::NativeTheme::State prev_state =
+ gfx::NativeTheme::ExtraParams prev_extra;
+ gfx::NativeTheme::State prev_state =
delegate_->GetBackgroundThemeState(&prev_extra);
native_theme->Paint(canvas->sk_canvas(), part, prev_state, rect,
prev_extra);
// Composite foreground state above it.
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
int alpha = delegate_->GetThemeAnimation()->CurrentValueBetween(0, 255);
canvas->SaveLayerAlpha(static_cast<uint8>(alpha));
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
canvas->Restore();
} else {
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
}
}
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 9a10622..1cbc98b 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -21,7 +21,6 @@
#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
#include "ui/base/keycodes/keyboard_code_conversion_win.h"
#include "ui/base/l10n/l10n_util_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
#include "ui/base/theme_provider.h"
#include "ui/base/view_prop.h"
#include "ui/base/win/hwnd_util.h"
@@ -30,6 +29,7 @@
#include "ui/gfx/canvas_paint.h"
#include "ui/gfx/canvas_skia_paint.h"
#include "ui/gfx/icon_util.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/gfx/path.h"
#include "ui/gfx/screen.h"
#include "ui/views/accessibility/native_view_accessibility_win.h"
@@ -2040,7 +2040,7 @@ void NativeWidgetWin::OnSysCommand(UINT notification_code, CPoint click) {
void NativeWidgetWin::OnThemeChanged() {
// Notify NativeThemeWin.
- ui::NativeThemeWin::instance()->CloseHandles();
+ gfx::NativeThemeWin::instance()->CloseHandles();
}
void NativeWidgetWin::OnVScroll(int scroll_type,
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 5c28bdd..8c9d9f8 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -19,10 +19,10 @@
#include "ui/base/hit_test.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
+#include "ui/gfx/native_theme.h"
#include "ui/views/controls/button/text_button.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/root_view.h"
@@ -305,8 +305,8 @@ const DialogClientView* DialogClientView::AsDialogClientView() const {
// DialogClientView, View overrides:
void DialogClientView::OnPaint(gfx::Canvas* canvas) {
- SkColor bg_color = ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_DialogBackground);
+ SkColor bg_color = gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_DialogBackground);
canvas->FillRect(GetLocalBounds(), bg_color);
}
@@ -420,9 +420,9 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
if (GetWidget()->widget_delegate()->CanResize() ||
GetWidget()->widget_delegate()->CanMaximize()) {
#if defined(OS_WIN)
- ui::NativeTheme::ExtraParams extra;
- gfx::Size gripper_size = ui::NativeTheme::instance()->GetPartSize(
- ui::NativeTheme::kWindowResizeGripper, ui::NativeTheme::kNormal,
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::Size gripper_size = gfx::NativeTheme::instance()->GetPartSize(
+ gfx::NativeTheme::kWindowResizeGripper, gfx::NativeTheme::kNormal,
extra);
// TODO(beng): (http://b/1085509) In "classic" rendering mode, there isn't
@@ -433,11 +433,11 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
size_box_bounds_.set_x(size_box_bounds_.right() - gripper_size.width());
size_box_bounds_.set_y(size_box_bounds_.bottom() - gripper_size.height());
- ui::NativeTheme::instance()->Paint(canvas->sk_canvas(),
- ui::NativeTheme::kWindowResizeGripper,
- ui::NativeTheme::kNormal,
- size_box_bounds_,
- extra);
+ gfx::NativeTheme::instance()->Paint(canvas->sk_canvas(),
+ gfx::NativeTheme::kWindowResizeGripper,
+ gfx::NativeTheme::kNormal,
+ size_box_bounds_,
+ extra);
#else
NOTIMPLEMENTED();
// TODO(port): paint size box