summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 22:34:45 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 22:34:45 +0000
commit40be2019b4847656a11f0eaed72e3cef04e6feca (patch)
tree5244fc8d51032d3bee3fc93ebfe5528cc051891b
parenta68c660bd1bcfa93d9759bdac2b384587e911c04 (diff)
downloadchromium_src-40be2019b4847656a11f0eaed72e3cef04e6feca.zip
chromium_src-40be2019b4847656a11f0eaed72e3cef04e6feca.tar.gz
chromium_src-40be2019b4847656a11f0eaed72e3cef04e6feca.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136996 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc8
-rw-r--r--content/renderer/render_view_impl.cc12
-rw-r--r--ui/base/native_theme/native_theme.cc (renamed from ui/gfx/native_theme.cc)10
-rw-r--r--ui/base/native_theme/native_theme.h (renamed from ui/gfx/native_theme.h)18
-rw-r--r--ui/base/native_theme/native_theme_android.cc (renamed from ui/gfx/native_theme_android.cc)42
-rw-r--r--ui/base/native_theme/native_theme_android.h (renamed from ui/gfx/native_theme_android.h)21
-rw-r--r--ui/base/native_theme/native_theme_aura.cc (renamed from ui/gfx/native_theme_aura.cc)6
-rw-r--r--ui/base/native_theme/native_theme_aura.h (renamed from ui/gfx/native_theme_aura.h)18
-rw-r--r--ui/base/native_theme/native_theme_base.cc (renamed from ui/gfx/native_theme_base.cc)6
-rw-r--r--ui/base/native_theme/native_theme_base.h (renamed from ui/gfx/native_theme_base.h)14
-rw-r--r--ui/base/native_theme/native_theme_gtk.cc (renamed from ui/gfx/native_theme_gtk.cc)6
-rw-r--r--ui/base/native_theme/native_theme_gtk.h (renamed from ui/gfx/native_theme_gtk.h)14
-rw-r--r--ui/base/native_theme/native_theme_win.cc (renamed from ui/gfx/native_theme_win.cc)34
-rw-r--r--ui/base/native_theme/native_theme_win.h (renamed from ui/gfx/native_theme_win.h)22
-rw-r--r--ui/base/native_theme/native_theme_win_unittest.cc15
-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
-rw-r--r--webkit/glue/webthemeengine_impl_android.cc64
-rw-r--r--webkit/glue/webthemeengine_impl_linux.cc66
-rw-r--r--webkit/glue/webthemeengine_impl_win.cc438
-rw-r--r--webkit/tools/test_shell/test_shell_platform_delegate_win.cc9
56 files changed, 748 insertions, 719 deletions
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
index ead319f..5f3775c 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
@@ -20,11 +20,11 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.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/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
-#include "ui/gfx/native_theme.h"
namespace {
@@ -139,11 +139,11 @@ SkColor AutocompleteResultView::GetColor(ResultViewState state,
colors[NORMAL][TEXT] = color_utils::GetSysSkColor(COLOR_WINDOWTEXT);
colors[SELECTED][TEXT] = color_utils::GetSysSkColor(COLOR_HIGHLIGHTTEXT);
#elif defined(USE_AURA)
- const gfx::NativeTheme* theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* theme = ui::NativeTheme::instance();
colors[SELECTED][BACKGROUND] = theme->GetSystemColor(
- gfx::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused);
+ ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused);
colors[NORMAL][BACKGROUND] = theme->GetSystemColor(
- gfx::NativeTheme::kColorId_TextfieldDefaultBackground);
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground);
colors[NORMAL][URL] = SkColorSetARGB(0xff, 0x00, 0x99, 0x33);
colors[SELECTED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22);
colors[HOVERED][URL] = SkColorSetARGB(0xff, 0x00, 0x66, 0x22);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 841f41c..e87735f 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -54,6 +54,8 @@
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/renderer/render_view_visitor.h"
+#include "content/renderer/browser_plugin/browser_plugin_constants.h"
+#include "content/renderer/browser_plugin/browser_plugin_placeholder.h"
#include "content/renderer/device_orientation_dispatcher.h"
#include "content/renderer/devtools_agent.h"
#include "content/renderer/dom_automation_controller.h"
@@ -77,8 +79,6 @@
#include "content/renderer/notification_provider.h"
#include "content/renderer/p2p/socket_dispatcher.h"
#include "content/renderer/plugin_channel_host.h"
-#include "content/renderer/browser_plugin/browser_plugin_constants.h"
-#include "content/renderer/browser_plugin/browser_plugin_placeholder.h"
#include "content/renderer/render_process.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_widget_fullscreen_pepper.h"
@@ -183,10 +183,10 @@
#elif defined(OS_WIN)
// TODO(port): these files are currently Windows only because they concern:
// * theming
-#include "ui/gfx/native_theme_win.h"
+#include "ui/base/native_theme/native_theme_win.h"
#elif defined(USE_X11)
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
#elif defined(OS_MACOSX)
#include "skia/ext/skia_utils_mac.h"
#endif
@@ -4381,7 +4381,7 @@ void RenderViewImpl::OnSetRendererPrefs(
WebColorName name = WebKit::WebColorWebkitFocusRingColor;
WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1);
WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval);
- gfx::NativeTheme::instance()->SetScrollbarColors(
+ ui::NativeTheme::instance()->SetScrollbarColors(
renderer_prefs.thumb_inactive_color,
renderer_prefs.thumb_active_color,
renderer_prefs.track_color);
@@ -4552,7 +4552,7 @@ void RenderViewImpl::OnThemeChanged() {
#if defined(USE_AURA)
// Aura doesn't care if we switch themes.
#elif defined(OS_WIN)
- gfx::NativeThemeWin::instance()->CloseHandles();
+ ui::NativeThemeWin::instance()->CloseHandles();
if (webview())
webview()->themeChanged();
#else // defined(OS_WIN)
diff --git a/ui/gfx/native_theme.cc b/ui/base/native_theme/native_theme.cc
index 331d429..c467d7e 100644
--- a/ui/gfx/native_theme.cc
+++ b/ui/base/native_theme/native_theme.cc
@@ -1,12 +1,10 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
-#include "ui/gfx/size.h"
-
-namespace gfx {
+namespace ui {
unsigned int NativeTheme::thumb_inactive_color_ = 0xeaeaea;
unsigned int NativeTheme::thumb_active_color_ = 0xf4f4f4;
@@ -23,4 +21,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 gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme.h b/ui/base/native_theme/native_theme.h
index 2a83dba..b37b1e7 100644
--- a/ui/gfx/native_theme.h
+++ b/ui/base/native_theme/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_GFX_NATIVE_THEME_H_
-#define UI_GFX_NATIVE_THEME_H_
+#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
+#define UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
#pragma once
#include "third_party/skia/include/core/SkColor.h"
@@ -13,9 +13,11 @@
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
@@ -198,9 +200,9 @@ class UI_EXPORT NativeTheme {
};
// Return the size of the part.
- virtual Size GetPartSize(Part part,
- State state,
- const ExtraParams& extra) const = 0;
+ virtual gfx::Size GetPartSize(Part part,
+ State state,
+ const ExtraParams& extra) const = 0;
// Paint the part to the canvas.
virtual void Paint(SkCanvas* canvas,
@@ -266,6 +268,6 @@ class UI_EXPORT NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeTheme);
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_H_
diff --git a/ui/gfx/native_theme_android.cc b/ui/base/native_theme/native_theme_android.cc
index ca5cde1..2f710f9 100644
--- a/ui/gfx/native_theme_android.cc
+++ b/ui/base/native_theme/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/gfx/native_theme_android.h"
+#include "ui/base/native_theme/native_theme_android.h"
#include <limits>
@@ -15,32 +15,30 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
-namespace gfx {
+namespace {
-static const unsigned int kButtonLength = 14;
-static const unsigned int kScrollbarWidth = 15;
-static const unsigned int kThumbInactiveColor = 0xeaeaea;
-static const unsigned int kTrackColor= 0xd3d3d3;
+const unsigned int kButtonLength = 14;
+const unsigned int kScrollbarWidth = 15;
+const unsigned int kThumbInactiveColor = 0xeaeaea;
+const unsigned int kTrackColor= 0xd3d3d3;
// These are the default dimensions of radio buttons and checkboxes.
-static const int kCheckboxAndRadioWidth = 13;
-static const int kCheckboxAndRadioHeight = 13;
+const int kCheckboxAndRadioWidth = 13;
+const int kCheckboxAndRadioHeight = 13;
// These sizes match the sizes in Chromium Win.
-static const int kSliderThumbWidth = 11;
-static const int kSliderThumbHeight = 21;
+const int kSliderThumbWidth = 11;
+const int kSliderThumbHeight = 21;
-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);
+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);
// Get lightness adjusted color.
-static SkColor BrightenColor(const color_utils::HSL& hsl,
- SkAlpha alpha,
- double lightness_amount) {
+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)
@@ -51,6 +49,10 @@ static SkColor BrightenColor(const color_utils::HSL& hsl,
return color_utils::HSLToSkColor(adjusted, alpha);
}
+} // namespace
+
+namespace ui {
+
// static
const NativeTheme* NativeTheme::instance() {
return NativeThemeAndroid::instance();
@@ -801,4 +803,4 @@ SkColor NativeThemeAndroid::OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const {
return SaturateAndBrighten(hsv2, -0.2, diff);
}
-} // namespace gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme_android.h b/ui/base/native_theme/native_theme_android.h
index 800c320..6f183da 100644
--- a/ui/gfx/native_theme_android.h
+++ b/ui/base/native_theme/native_theme_android.h
@@ -2,28 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_NATIVE_THEME_ANDROID_H_
-#define UI_GFX_NATIVE_THEME_ANDROID_H_
+#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
+#define UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
+#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "skia/ext/platform_canvas.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/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 Size GetPartSize(Part part,
- State state,
- const ExtraParams& extra) const OVERRIDE;
+ virtual gfx::Size GetPartSize(Part part,
+ State state,
+ const ExtraParams& extra) const OVERRIDE;
// Paint the part to the canvas.
virtual void Paint(SkCanvas* canvas,
@@ -167,6 +170,6 @@ class NativeThemeAndroid : public NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeThemeAndroid);
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_ANDROID_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_
diff --git a/ui/gfx/native_theme_aura.cc b/ui/base/native_theme/native_theme_aura.cc
index b3be18b..56336c0 100644
--- a/ui/gfx/native_theme_aura.cc
+++ b/ui/base/native_theme/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/gfx/native_theme_aura.h"
+#include "ui/base/native_theme/native_theme_aura.h"
#include "base/logging.h"
#include "grit/gfx_resources.h"
@@ -49,7 +49,7 @@ const SkColor kTextfieldSelectionColor =
} // namespace
-namespace gfx {
+namespace ui {
// static
const NativeTheme* NativeTheme::instance() {
@@ -292,4 +292,4 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas,
}
}
-} // namespace gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme_aura.h b/ui/base/native_theme/native_theme_aura.h
index de4b10d..3eb05c2 100644
--- a/ui/gfx/native_theme_aura.h
+++ b/ui/base/native_theme/native_theme_aura.h
@@ -2,17 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_NATIVE_THEME_AURA_H_
-#define UI_GFX_NATIVE_THEME_AURA_H_
+#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
+#define UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "ui/gfx/native_theme_base.h"
+#include "ui/base/native_theme/native_theme_base.h"
-namespace gfx {
+namespace gfx{
+class Rect;
+class Size;
+}
+
+namespace ui {
-// Aura implementation of native theme support.
class NativeThemeAura : public NativeThemeBase {
public:
static const NativeThemeAura* instance();
@@ -43,6 +47,6 @@ class NativeThemeAura : public NativeThemeBase {
DISALLOW_COPY_AND_ASSIGN(NativeThemeAura);
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_AURA_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_AURA_H_
diff --git a/ui/gfx/native_theme_base.cc b/ui/base/native_theme/native_theme_base.cc
index 6168382..4f86670 100644
--- a/ui/gfx/native_theme_base.cc
+++ b/ui/base/native_theme/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/gfx/native_theme_base.h"
+#include "ui/base/native_theme/native_theme_base.h"
#include <limits>
@@ -51,7 +51,7 @@ SkColor BrightenColor(const color_utils::HSL& hsl, SkAlpha alpha,
} // namespace
-namespace gfx {
+namespace ui {
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 gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme_base.h b/ui/base/native_theme/native_theme_base.h
index 562f934..5cc86fe 100644
--- a/ui/gfx/native_theme_base.h
+++ b/ui/base/native_theme/native_theme_base.h
@@ -2,17 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_NATIVE_THEME_BASE_H_
-#define UI_GFX_NATIVE_THEME_BASE_H_
+#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
+#define UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
+#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "skia/ext/platform_canvas.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
namespace gfx {
class Rect;
class Size;
+}
+
+namespace ui {
// Theme support for non-Windows toolkits.
class NativeThemeBase : public NativeTheme {
@@ -162,6 +166,6 @@ class NativeThemeBase : public NativeTheme {
DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_BASE_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_BASE_H_
diff --git a/ui/gfx/native_theme_gtk.cc b/ui/base/native_theme/native_theme_gtk.cc
index 53d2636..d8eab30 100644
--- a/ui/gfx/native_theme_gtk.cc
+++ b/ui/base/native_theme/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/gfx/native_theme_gtk.h"
+#include "ui/base/native_theme/native_theme_gtk.h"
#include <gtk/gtk.h>
@@ -29,7 +29,7 @@ const SkColor kTextButtonHoverColor = kTextButtonEnabledColor;
} // namespace
-namespace gfx {
+namespace ui {
// static
const NativeTheme* NativeTheme::instance() {
@@ -84,4 +84,4 @@ NativeThemeGtk::NativeThemeGtk() {
NativeThemeGtk::~NativeThemeGtk() {
}
-} // namespace gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme_gtk.h b/ui/base/native_theme/native_theme_gtk.h
index 2fb205c..257d49f 100644
--- a/ui/gfx/native_theme_gtk.h
+++ b/ui/base/native_theme/native_theme_gtk.h
@@ -1,14 +1,14 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef UI_GFX_NATIVE_THEME_GTK_H_
-#define UI_GFX_NATIVE_THEME_GTK_H_
+#ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
+#define UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
#pragma once
-#include "ui/gfx/native_theme_base.h"
+#include "ui/base/native_theme/native_theme_base.h"
-namespace gfx {
+namespace ui {
// GTK implementation of native theme support.
class NativeThemeGtk : public NativeThemeBase {
@@ -22,6 +22,6 @@ class NativeThemeGtk : public NativeThemeBase {
virtual ~NativeThemeGtk();
};
-} // namespace gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_GTK_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_GTK_H_
diff --git a/ui/gfx/native_theme_win.cc b/ui/base/native_theme/native_theme_win.cc
index 28574a2..abe605f 100644
--- a/ui/gfx/native_theme_win.cc
+++ b/ui/base/native_theme/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/gfx/native_theme_win.h"
+#include "ui/base/native_theme/native_theme_win.h"
#include <windows.h>
#include <uxtheme.h>
@@ -120,7 +120,7 @@ RECT InsetRect(const RECT* rect, int size) {
} // namespace
-namespace gfx {
+namespace ui {
bool NativeThemeWin::IsThemingActive() const {
if (is_theme_active_)
@@ -156,14 +156,14 @@ SkColor NativeThemeWin::GetThemeColorWithDefault(ThemeName theme,
return color;
}
-Size NativeThemeWin::GetThemeBorderSize(ThemeName theme) const {
+gfx::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 Size(border, border);
+ return gfx::Size(border, border);
else
- return Size(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
+ return gfx::Size(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
}
void NativeThemeWin::DisableTheming() const {
@@ -279,7 +279,7 @@ gfx::Size NativeThemeWin::GetPartSize(Part part,
}
}
- return Size(size.cx, size.cy);
+ return gfx::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.
- Rect r(rect);
+ gfx::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 gfx::NativeTheme::kScrollbarHorizontalThumb:
+ case NativeTheme::kScrollbarHorizontalThumb:
part_id = SBP_THUMBBTNHORZ;
break;
- case gfx::NativeTheme::kScrollbarVerticalThumb:
+ case NativeTheme::kScrollbarVerticalThumb:
part_id = SBP_THUMBBTNVERT;
break;
- case gfx::NativeTheme::kScrollbarHorizontalGripper:
+ case NativeTheme::kScrollbarHorizontalGripper:
part_id = SBP_GRIPPERHORZ;
break;
- case gfx::NativeTheme::kScrollbarVerticalGripper:
+ case NativeTheme::kScrollbarVerticalGripper:
part_id = SBP_GRIPPERVERT;
break;
default:
@@ -1042,10 +1042,10 @@ HRESULT NativeThemeWin::PaintScrollbarTrack(
int state_id;
switch (part) {
- case gfx::NativeTheme::kScrollbarHorizontalTrack:
+ case NativeTheme::kScrollbarHorizontalTrack:
part_id = extra.is_upper ? SBP_UPPERTRACKHORZ : SBP_LOWERTRACKHORZ;
break;
- case gfx::NativeTheme::kScrollbarVerticalTrack:
+ case 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 gfx::NativeTheme::kHovered:
+ case NativeTheme::kHovered:
bg_color_key = COLOR_HIGHLIGHT;
text_color_key = COLOR_HIGHLIGHTTEXT;
break;
- case gfx::NativeTheme::kNormal:
+ case NativeTheme::kNormal:
bg_color_key = COLOR_MENU;
text_color_key = COLOR_MENUTEXT;
break;
- case gfx::NativeTheme::kDisabled:
+ case 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 gfx
+} // namespace ui
diff --git a/ui/gfx/native_theme_win.h b/ui/base/native_theme/native_theme_win.h
index 8427442..260de8d 100644
--- a/ui/gfx/native_theme_win.h
+++ b/ui/base/native_theme/native_theme_win.h
@@ -1,29 +1,29 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
-//
+
+#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/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/size.h"
class SkCanvas;
-namespace gfx {
+namespace ui {
// 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.
- Size GetThemeBorderSize(ThemeName theme) const;
+ gfx::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 gfx
+} // namespace ui
-#endif // UI_GFX_NATIVE_THEME_WIN_H_
+#endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_
diff --git a/ui/base/native_theme/native_theme_win_unittest.cc b/ui/base/native_theme/native_theme_win_unittest.cc
new file mode 100644
index 0000000..b711921
--- /dev/null
+++ b/ui/base/native_theme/native_theme_win_unittest.cc
@@ -0,0 +1,15 @@
+// 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/gfx/native_theme_win_unittest.cc b/ui/gfx/native_theme_win_unittest.cc
deleted file mode 100644
index cce3861..0000000
--- a/ui/gfx/native_theme_win_unittest.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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 79ded6f..3c8b720 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -15,11 +15,12 @@
#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/skia_util.h"
#include "ui/gfx/shadow_value.h"
+#include "ui/gfx/skia_util.h"
namespace {
@@ -737,7 +738,12 @@ 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);
@@ -752,7 +758,13 @@ 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(
@@ -950,9 +962,17 @@ 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 ed5b79a..0004cb3 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -212,6 +212,18 @@
'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',
@@ -332,18 +344,6 @@
'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!': [
- 'gfx/native_theme_aura.cc',
- 'gfx/native_theme_aura.h',
+ 'base/native_theme/native_theme_aura.cc',
+ 'base/native_theme/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', 'gfx/native_theme_win.cc'],
- ['exclude', 'gfx/native_theme_win.h'],
+ ['exclude', 'base/native_theme/native_theme_win.cc'],
+ ['exclude', 'base/native_theme/native_theme_win.h'],
['exclude', 'gfx/path_win.cc'],
],
}],
@@ -534,18 +534,18 @@
],
}, { # toolkit_uses_gtk != 1
'sources!': [
- 'gfx/native_theme_gtk.cc',
- 'gfx/native_theme_gtk.h',
+ 'base/native_theme/native_theme_gtk.cc',
+ 'base/native_theme/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',
- 'gfx/native_theme_win.cc',
- 'gfx/native_theme_win.h',
+ 'base/native_theme/native_theme_win.cc',
+ 'base/native_theme/native_theme_win.h',
],
'sources/': [
['exclude', '^base/win/*'],
diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi
index 0f6d293..2a0a121 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!': [
- 'gfx/screen_unittest.cc',
- 'gfx/native_theme_win_unittest.cc',
'base/dragdrop/os_exchange_data_win_unittest.cc',
+ 'base/native_theme/native_theme_win_unittest.cc',
+ 'gfx/screen_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 8e85a2d..cfedcce 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -36,11 +36,10 @@ void Checkbox::SetChecked(bool checked) {
gfx::Size Checkbox::GetPreferredSize() {
gfx::Size prefsize(TextButtonBase::GetPreferredSize());
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = GetThemeState(&extra);
- gfx::Size size = gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
- state,
- extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State state = GetThemeState(&extra);
+ gfx::Size size = ui::NativeTheme::instance()->GetPartSize(GetThemePart(),
+ state, extra);
prefsize.Enlarge(size.width(), 0);
prefsize.set_height(std::max(prefsize.height(), size.height()));
@@ -76,16 +75,15 @@ void Checkbox::NotifyClick(const views::Event& event) {
TextButtonBase::NotifyClick(event);
}
-gfx::NativeTheme::Part Checkbox::GetThemePart() const {
- return gfx::NativeTheme::kCheckbox;
+ui::NativeTheme::Part Checkbox::GetThemePart() const {
+ return ui::NativeTheme::kCheckbox;
}
gfx::Rect Checkbox::GetThemePaintRect() const {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = GetThemeState(&extra);
- gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
- state,
- extra));
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State state = GetThemeState(&extra);
+ gfx::Size size(ui::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());
@@ -93,18 +91,17 @@ gfx::Rect Checkbox::GetThemePaintRect() const {
return rect;
}
-void Checkbox::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
+void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
TextButtonBase::GetExtraParams(params);
params->button.checked = checked_;
}
gfx::Rect Checkbox::GetTextBounds() const {
gfx::Rect bounds(TextButtonBase::GetTextBounds());
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = GetThemeState(&extra);
- gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
- state,
- extra));
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State state = GetThemeState(&extra);
+ gfx::Size size(ui::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 b86c7c6..7554cfd 100644
--- a/ui/views/controls/button/checkbox.h
+++ b/ui/views/controls/button/checkbox.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -43,10 +43,10 @@ class VIEWS_EXPORT Checkbox : public TextButtonBase {
virtual void NotifyClick(const views::Event& event) OVERRIDE;
// Overridden from TextButtonBase:
- virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
virtual void GetExtraParams(
- gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::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 1c3352cd..5218bcf 100644
--- a/ui/views/controls/button/radio_button.cc
+++ b/ui/views/controls/button/radio_button.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -97,8 +97,8 @@ void RadioButton::NotifyClick(const views::Event& event) {
TextButtonBase::NotifyClick(event);
}
-gfx::NativeTheme::Part RadioButton::GetThemePart() const {
- return gfx::NativeTheme::kRadio;
+ui::NativeTheme::Part RadioButton::GetThemePart() const {
+ return ui::NativeTheme::kRadio;
}
} // namespace views
diff --git a/ui/views/controls/button/radio_button.h b/ui/views/controls/button/radio_button.h
index 19ef602..2fa9a97 100644
--- a/ui/views/controls/button/radio_button.h
+++ b/ui/views/controls/button/radio_button.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -32,7 +32,7 @@ class VIEWS_EXPORT RadioButton : public Checkbox {
virtual void NotifyClick(const views::Event& event) OVERRIDE;
// Overridden from TextButtonBase:
- virtual gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::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 89aa97d..1e616da 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/gfx/native_theme_win.h"
+#include "ui/base/native_theme/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 gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
- gfx::NativeTheme::Part part = delegate_->GetThemePart();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ ui::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.
- gfx::NativeTheme::ExtraParams prev_extra;
- gfx::NativeTheme::State prev_state =
+ ui::NativeTheme::ExtraParams prev_extra;
+ ui::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.
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::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 {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::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_(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)),
+ 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)),
text_halo_color_(0),
has_text_halo_(false),
active_text_shadow_color_(0),
@@ -458,15 +458,15 @@ int TextButtonBase::ComputeCanvasStringFlags() const {
}
void TextButtonBase::GetExtraParams(
- gfx::NativeTheme::ExtraParams* params) const {
+ ui::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 =
- gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_TextButtonBackgroundColor);
+ ui::NativeTheme::instance()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextButtonBackgroundColor);
}
gfx::Rect TextButtonBase::GetContentBounds(int extra_width) const {
@@ -608,21 +608,21 @@ gfx::Rect TextButtonBase::GetThemePaintRect() const {
return GetLocalBounds();
}
-gfx::NativeTheme::State TextButtonBase::GetThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State TextButtonBase::GetThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
switch(state()) {
case BS_DISABLED:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
case BS_NORMAL:
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
case BS_HOT:
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
case BS_PUSHED:
- return gfx::NativeTheme::kPressed;
+ return ui::NativeTheme::kPressed;
default:
NOTREACHED() << "Unknown state: " << state();
- return gfx::NativeTheme::kNormal;
+ return ui::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 gfx::NativeThemeWin::instance()->IsThemingActive()
+ return ui::NativeThemeWin::instance()->IsThemingActive()
? hover_animation_.get() : NULL;
#else
return hover_animation_.get();
#endif
}
-gfx::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
}
-gfx::NativeTheme::State TextButtonBase::GetForegroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State TextButtonBase::GetForegroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
}
////////////////////////////////////////////////////////////////////////////////
@@ -756,11 +756,11 @@ void TextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
}
}
-gfx::NativeTheme::Part TextButton::GetThemePart() const {
- return gfx::NativeTheme::kPushButton;
+ui::NativeTheme::Part TextButton::GetThemePart() const {
+ return ui::NativeTheme::kPushButton;
}
-void TextButton::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
+void TextButton::GetExtraParams(ui::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(
- gfx::NativeTheme::ExtraParams* params) const {
+ ui::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 2e1f285..2dd1cb8 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 gfx::NativeTheme::State GetThemeState(
- gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual ui::NativeTheme::State GetThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual const ui::Animation* GetThemeAnimation() 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 ui::NativeTheme::State GetBackgroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual ui::NativeTheme::State GetForegroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
- virtual void GetExtraParams(gfx::NativeTheme::ExtraParams* params) const;
+ virtual void GetExtraParams(ui::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 gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
// Overridden from TextButtonBase:
virtual void GetExtraParams(
- gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::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(
- gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ ui::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 fbf7adf..21c11c2 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 = gfx::NativeThemeWin::instance()->GetThemeBorderSize(
- gfx::NativeThemeWin::MENULIST);
+ gfx::Size border = ui::NativeThemeWin::instance()->GetThemeBorderSize(
+ ui::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 6cdd1c3..c603df9 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 = gfx::NativeTheme::instance()->GetSystemColor(
- has_focus_ ? gfx::NativeTheme::kColorId_FocusedBorderColor
- : gfx::NativeTheme::kColorId_UnfocusedBorderColor);
+ SkColor focus_color = ui::NativeTheme::instance()->GetSystemColor(
+ has_focus_ ? ui::NativeTheme::kColorId_FocusedBorderColor
+ : ui::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 ac40fe5..f907f9f 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_ = 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);
+ 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);
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 0142240..88edb10 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 = gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor);
+ config->text_color = ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 07681fe..86d4b64 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) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -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/gfx/native_theme_win.h"
+#include "ui/base/native_theme/native_theme_win.h"
-using gfx::NativeTheme;
-using gfx::NativeThemeWin;
+using ui::NativeTheme;
+using ui::NativeThemeWin;
namespace views {
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 74d458c..d07d7a4 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, gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_TextButtonDisabledColor),
+ accel_text, font, ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 dbc22f6..f61453a 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/gfx/native_theme.h"
+#include "ui/base/native_theme/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,
- gfx::NativeTheme::State state,
+ ui::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 6942dc9..1253ba4 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 = gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_FocusedMenuItemBackgroundColor);
+ SkColor bg_color = ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 = gfx::NativeTheme::instance()->GetSystemColor(
- enabled() ? gfx::NativeTheme::kColorId_EnabledMenuItemForegroundColor
- : gfx::NativeTheme::kColorId_DisabledMenuItemForegroundColor);
+ SkColor fg_color = ui::NativeTheme::instance()->GetSystemColor(
+ enabled() ? ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor
+ : ui::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 8458e22..bca528a 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 gfx::NativeTheme;
+using ui::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 = gfx::NativeThemeWin::instance()->GetThemeColorWithDefault(
- gfx::NativeThemeWin::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
+ SkColor fg_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
+ ui::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.
- gfx::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::ExtraParams extra;
extra.menu_arrow.pointing_right = !base::i18n::IsRTL();
extra.menu_arrow.is_selected = render_selection;
- gfx::NativeTheme::instance()->Paint(canvas->sk_canvas(),
- gfx::NativeTheme::kMenuPopupArrow, control_state, arrow_bounds, extra);
+ ui::NativeTheme::instance()->Paint(canvas->sk_canvas(),
+ ui::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 f8f36b8..5d91d6d 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 gfx::NativeTheme;
+using ui::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 484825f..61ec07d 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),
- gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_MenuSeparatorColor));
+ ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 a5769140..edd06d5 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 gfx::NativeTheme* theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* theme = ui::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());
- gfx::NativeTheme::ExtraParams extra;
- theme->Paint(canvas->sk_canvas(), gfx::NativeTheme::kMenuPopupGutter,
- gfx::NativeTheme::kNormal, gutter_bounds, extra);
+ ui::NativeTheme::ExtraParams extra;
+ theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kMenuPopupGutter,
+ ui::NativeTheme::kNormal, gutter_bounds, extra);
start_x = gutter_bounds.x() + config.gutter_width;
}
gfx::Rect separator_bounds(start_x, 0, width(), height());
- gfx::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::ExtraParams extra;
extra.menu_separator.has_gutter = config.render_gutter;
- theme->Paint(canvas->sk_canvas(), gfx::NativeTheme::kMenuPopupSeparator,
- gfx::NativeTheme::kNormal, separator_bounds, extra);
+ theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
+ ui::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 ba60cab..bb23b09 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 gfx::NativeTheme;
+using ui::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 7eb2a08..0d61986 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:
- gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
- gfx::NativeTheme::Part GetNativeThemePart() const;
- gfx::NativeTheme::State GetNativeThemeState() const;
+ ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ ui::NativeTheme::Part GetNativeThemePart() const;
+ ui::NativeTheme::State GetNativeThemeState() const;
Type type_;
};
@@ -63,9 +63,9 @@ class ScrollBarThumb : public BaseScrollBarThumb {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
private:
- gfx::NativeTheme::ExtraParams GetNativeThemeParams() const;
- gfx::NativeTheme::Part GetNativeThemePart() const;
- gfx::NativeTheme::State GetNativeThemeState() const;
+ ui::NativeTheme::ExtraParams GetNativeThemeParams() const;
+ ui::NativeTheme::Part GetNativeThemePart() const;
+ ui::NativeTheme::State GetNativeThemeState() const;
ScrollBar* scroll_bar_;
};
@@ -86,22 +86,21 @@ ScrollBarButton::~ScrollBarButton() {
}
gfx::Size ScrollBarButton::GetPreferredSize() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarButton::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
gfx::Rect bounds(GetPreferredSize());
native_theme->Paint(canvas->sk_canvas(), GetNativeThemePart(),
GetNativeThemeState(), bounds, GetNativeThemeParams());
}
-gfx::NativeTheme::ExtraParams
- ScrollBarButton::GetNativeThemeParams() const {
- gfx::NativeTheme::ExtraParams params;
+ui::NativeTheme::ExtraParams ScrollBarButton::GetNativeThemeParams() const {
+ ui::NativeTheme::ExtraParams params;
switch (state_) {
case CustomButton::BS_HOT:
@@ -115,39 +114,37 @@ gfx::NativeTheme::ExtraParams
return params;
}
-gfx::NativeTheme::Part
- ScrollBarButton::GetNativeThemePart() const {
+ui::NativeTheme::Part ScrollBarButton::GetNativeThemePart() const {
switch (type_) {
case UP:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
case DOWN:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
case LEFT:
- return gfx::NativeTheme::kScrollbarLeftArrow;
+ return ui::NativeTheme::kScrollbarLeftArrow;
case RIGHT:
- return gfx::NativeTheme::kScrollbarRightArrow;
+ return ui::NativeTheme::kScrollbarRightArrow;
default:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
}
}
-gfx::NativeTheme::State
- ScrollBarButton::GetNativeThemeState() const {
- gfx::NativeTheme::State state;
+ui::NativeTheme::State ScrollBarButton::GetNativeThemeState() const {
+ ui::NativeTheme::State state;
switch (state_) {
case CustomButton::BS_HOT:
- state = gfx::NativeTheme::kHovered;
+ state = ui::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = gfx::NativeTheme::kPressed;
+ state = ui::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = gfx::NativeTheme::kDisabled;
+ state = ui::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = gfx::NativeTheme::kNormal;
+ state = ui::NativeTheme::kNormal;
break;
}
@@ -168,14 +165,14 @@ ScrollBarThumb::~ScrollBarThumb() {
}
gfx::Size ScrollBarThumb::GetPreferredSize() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
return native_theme->GetPartSize(GetNativeThemePart(),
GetNativeThemeState(),
GetNativeThemeParams());
}
void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
native_theme->Paint(canvas->sk_canvas(),
GetNativeThemePart(),
@@ -184,9 +181,8 @@ void ScrollBarThumb::OnPaint(gfx::Canvas* canvas) {
GetNativeThemeParams());
}
-gfx::NativeTheme::ExtraParams
- ScrollBarThumb::GetNativeThemeParams() const {
- gfx::NativeTheme::ExtraParams params;
+ui::NativeTheme::ExtraParams ScrollBarThumb::GetNativeThemeParams() const {
+ ui::NativeTheme::ExtraParams params;
switch (GetState()) {
case CustomButton::BS_HOT:
@@ -200,28 +196,28 @@ gfx::NativeTheme::ExtraParams
return params;
}
-gfx::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
+ui::NativeTheme::Part ScrollBarThumb::GetNativeThemePart() const {
if (scroll_bar_->IsHorizontal())
- return gfx::NativeTheme::kScrollbarHorizontalThumb;
- return gfx::NativeTheme::kScrollbarVerticalThumb;
+ return ui::NativeTheme::kScrollbarHorizontalThumb;
+ return ui::NativeTheme::kScrollbarVerticalThumb;
}
-gfx::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
- gfx::NativeTheme::State state;
+ui::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const {
+ ui::NativeTheme::State state;
switch (GetState()) {
case CustomButton::BS_HOT:
- state = gfx::NativeTheme::kHovered;
+ state = ui::NativeTheme::kHovered;
break;
case CustomButton::BS_PUSHED:
- state = gfx::NativeTheme::kPressed;
+ state = ui::NativeTheme::kPressed;
break;
case CustomButton::BS_DISABLED:
- state = gfx::NativeTheme::kDisabled;
+ state = ui::NativeTheme::kDisabled;
break;
case CustomButton::BS_NORMAL:
default:
- state = gfx::NativeTheme::kNormal;
+ state = ui::NativeTheme::kNormal;
break;
}
@@ -246,15 +242,15 @@ NativeScrollBarViews::NativeScrollBarViews(NativeScrollBar* scroll_bar)
prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT);
next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT);
- part_ = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ part_ = ui::NativeTheme::kScrollbarHorizontalTrack;
} else {
prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP);
next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN);
- part_ = gfx::NativeTheme::kScrollbarVerticalTrack;
+ part_ = ui::NativeTheme::kScrollbarVerticalTrack;
}
- state_ = gfx::NativeTheme::kNormal;
+ state_ = ui::NativeTheme::kNormal;
AddChildView(prev_button_);
AddChildView(next_button_);
@@ -285,7 +281,7 @@ void NativeScrollBarViews::Layout() {
}
void NativeScrollBarViews::OnPaint(gfx::Canvas* canvas) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
gfx::Rect bounds = GetTrackBounds();
if (bounds.IsEmpty())
@@ -386,20 +382,20 @@ NativeScrollBarWrapper* NativeScrollBarWrapper::CreateWrapper(
// static
int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams button_params;
+ ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarLeftArrow,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarLeftArrow,
+ ui::NativeTheme::kNormal,
button_params);
- gfx::NativeTheme::ExtraParams thumb_params;
+ ui::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarHorizontalThumb,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarHorizontalThumb,
+ ui::NativeTheme::kNormal,
thumb_params);
return std::max(track_size.height(), button_size.height());
@@ -407,20 +403,20 @@ int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
// static
int NativeScrollBarWrapper::GetVerticalScrollBarWidth() {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams button_params;
+ ui::NativeTheme::ExtraParams button_params;
button_params.scrollbar_arrow.is_hovering = false;
gfx::Size button_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarUpArrow,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarUpArrow,
+ ui::NativeTheme::kNormal,
button_params);
- gfx::NativeTheme::ExtraParams thumb_params;
+ ui::NativeTheme::ExtraParams thumb_params;
thumb_params.scrollbar_thumb.is_hovering = false;
gfx::Size track_size = native_theme->GetPartSize(
- gfx::NativeTheme::kScrollbarVerticalThumb,
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::kScrollbarVerticalThumb,
+ ui::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 136338c..0335e7f 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) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -7,7 +7,7 @@
#pragma once
#include "base/compiler_specific.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/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_;
- gfx::NativeTheme::ExtraParams params_;
- gfx::NativeTheme::Part part_;
- gfx::NativeTheme::State state_;
+ ui::NativeTheme::ExtraParams params_;
+ ui::NativeTheme::Part part_;
+ ui::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 f6924ef3..8b66e91 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 =
- gfx::NativeThemeWin::instance()->GetThemeColorWithDefault(
- gfx::NativeThemeWin::TAB, TABP_BODY, 0, TMT_FILLCOLORHINT,
+ ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
+ ui::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());
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::instance()->Paint(
- canvas->sk_canvas(), gfx::NativeTheme::kTabPanelBackground,
- gfx::NativeTheme::kNormal, r, extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::instance()->Paint(
+ canvas->sk_canvas(), ui::NativeTheme::kTabPanelBackground,
+ ui::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 161d21c..69bd813 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, gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_UnfocusedBorderColor)));
+ 1, ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 f037923..81ef1eb 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;
- gfx::NativeThemeWin::instance()->PaintTextField(hdc, part, state,
- classic_state, &window_rect,
- bg_color_, false, true);
+ ui::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 a931a16..d707166 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 92a6c2b..94893d1 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, gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_UnfocusedBorderColor)));
+ 1, ui::NativeTheme::instance()->GetSystemColor(
+ ui::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 c8a5e59..86e8ab7 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 gfx::NativeTheme::kPushButton:
+ case ui::NativeTheme::kPushButton:
message = "Pressed! count:%d";
break;
- case gfx::NativeTheme::kRadio:
+ case ui::NativeTheme::kRadio:
is_checked_ = !is_checked_;
message = is_checked_ ? "Checked! count:%d" : "Unchecked! count:%d";
break;
- case gfx::NativeTheme::kCheckbox:
+ case ui::NativeTheme::kCheckbox:
if (is_indeterminate_) {
is_checked_ = false;
is_indeterminate_ = false;
@@ -98,46 +98,45 @@ void ExampleNativeThemeButton::OnSelectedIndexChanged(Combobox* combobox) {
SchedulePaint();
}
-gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
+ui::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const {
switch (cb_part_->selected_index()) {
case 0:
- return gfx::NativeTheme::kPushButton;
+ return ui::NativeTheme::kPushButton;
case 1:
- return gfx::NativeTheme::kRadio;
+ return ui::NativeTheme::kRadio;
case 2:
- return gfx::NativeTheme::kCheckbox;
+ return ui::NativeTheme::kCheckbox;
default:
NOTREACHED();
}
- return gfx::NativeTheme::kPushButton;
+ return ui::NativeTheme::kPushButton;
}
gfx::Rect ExampleNativeThemeButton::GetThemePaintRect() const {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = GetThemeState(&extra);
- gfx::Size size(gfx::NativeTheme::instance()->GetPartSize(GetThemePart(),
- state,
- extra));
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State state = GetThemeState(&extra);
+ gfx::Size size(ui::NativeTheme::instance()->GetPartSize(GetThemePart(), state,
+ extra));
gfx::Rect rect(size);
rect.set_x(GetMirroredXForRect(rect));
return rect;
}
-gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
int selected = cb_state_->selected_index();
if (selected > 3) {
switch (state()) {
case BS_DISABLED:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
case BS_NORMAL:
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
case BS_HOT:
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
case BS_PUSHED:
- return gfx::NativeTheme::kPressed;
+ return ui::NativeTheme::kPressed;
default:
NOTREACHED();
}
@@ -145,21 +144,21 @@ gfx::NativeTheme::State ExampleNativeThemeButton::GetThemeState(
switch (selected) {
case 0:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
case 1:
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
case 2:
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
case 3:
- return gfx::NativeTheme::kPressed;
+ return ui::NativeTheme::kPressed;
default:
NOTREACHED();
}
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
}
void ExampleNativeThemeButton::GetExtraParams(
- gfx::NativeTheme::ExtraParams* params) const {
+ ui::NativeTheme::ExtraParams* params) const {
params->button.checked = is_checked_;
params->button.indeterminate = is_indeterminate_;
@@ -173,16 +172,16 @@ const ui::Animation* ExampleNativeThemeButton::GetThemeAnimation() const {
return cb_state_->selected_index() <= 3 ? NULL : hover_animation_.get();
}
-gfx::NativeTheme::State ExampleNativeThemeButton::GetBackgroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State ExampleNativeThemeButton::GetBackgroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
}
-gfx::NativeTheme::State ExampleNativeThemeButton::GetForegroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const {
+ui::NativeTheme::State ExampleNativeThemeButton::GetForegroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return gfx::NativeTheme::kHovered;
+ return ui::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 e77038e..2bc940c 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/gfx/native_theme.h"
+#include "ui/base/native_theme/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 gfx::NativeTheme::Part GetThemePart() const OVERRIDE;
+ virtual ui::NativeTheme::Part GetThemePart() const OVERRIDE;
virtual gfx::Rect GetThemePaintRect() const OVERRIDE;
- virtual gfx::NativeTheme::State GetThemeState(
- gfx::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual ui::NativeTheme::State GetThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
virtual const ui::Animation* GetThemeAnimation() 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 ui::NativeTheme::State GetBackgroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
+ virtual ui::NativeTheme::State GetForegroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const OVERRIDE;
- void GetExtraParams(gfx::NativeTheme::ExtraParams* params) const;
+ void GetExtraParams(ui::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 6ff0869..f7c3858 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) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -7,7 +7,6 @@
#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 bd6051e..9f2945d 100644
--- a/ui/views/native_theme_delegate.h
+++ b/ui/views/native_theme_delegate.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,7 +6,7 @@
#define UI_VIEWS_NATIVE_THEME_DELEGATE_H_
#pragma once
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/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 gfx::NativeTheme::Part GetThemePart() const = 0;
+ virtual ui::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 gfx::NativeTheme::State GetThemeState(
- gfx::NativeTheme::ExtraParams* params) const = 0;
+ virtual ui::NativeTheme::State GetThemeState(
+ ui::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 gfx::NativeTheme::State GetBackgroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const = 0;
+ virtual ui::NativeTheme::State GetBackgroundThemeState(
+ ui::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 gfx::NativeTheme::State GetForegroundThemeState(
- gfx::NativeTheme::ExtraParams* params) const = 0;
+ virtual ui::NativeTheme::State GetForegroundThemeState(
+ ui::NativeTheme::ExtraParams* params) const = 0;
};
} // namespace views
diff --git a/ui/views/native_theme_painter.cc b/ui/views/native_theme_painter.cc
index 454ed3d..8acb532 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 gfx::NativeTheme* theme = gfx::NativeTheme::instance();
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ const ui::NativeTheme* theme = ui::NativeTheme::instance();
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State state = delegate_->GetThemeState(&extra);
return theme->GetPartSize(delegate_->GetThemePart(), state, extra);
}
void NativeThemePainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
- const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
- gfx::NativeTheme::Part part = delegate_->GetThemePart();
+ const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
+ ui::NativeTheme::Part part = delegate_->GetThemePart();
gfx::Rect rect(size);
if (delegate_->GetThemeAnimation() != NULL &&
delegate_->GetThemeAnimation()->is_animating()) {
// Paint background state.
- gfx::NativeTheme::ExtraParams prev_extra;
- gfx::NativeTheme::State prev_state =
+ ui::NativeTheme::ExtraParams prev_extra;
+ ui::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.
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::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 {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ ui::NativeTheme::ExtraParams extra;
+ ui::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 1cbc98b..9a10622 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -21,6 +21,7 @@
#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"
@@ -29,7 +30,6 @@
#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.
- gfx::NativeThemeWin::instance()->CloseHandles();
+ ui::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 8c9d9f8..5c28bdd 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 = gfx::NativeTheme::instance()->GetSystemColor(
- gfx::NativeTheme::kColorId_DialogBackground);
+ SkColor bg_color = ui::NativeTheme::instance()->GetSystemColor(
+ ui::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)
- gfx::NativeTheme::ExtraParams extra;
- gfx::Size gripper_size = gfx::NativeTheme::instance()->GetPartSize(
- gfx::NativeTheme::kWindowResizeGripper, gfx::NativeTheme::kNormal,
+ ui::NativeTheme::ExtraParams extra;
+ gfx::Size gripper_size = ui::NativeTheme::instance()->GetPartSize(
+ ui::NativeTheme::kWindowResizeGripper, ui::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());
- gfx::NativeTheme::instance()->Paint(canvas->sk_canvas(),
- gfx::NativeTheme::kWindowResizeGripper,
- gfx::NativeTheme::kNormal,
- size_box_bounds_,
- extra);
+ ui::NativeTheme::instance()->Paint(canvas->sk_canvas(),
+ ui::NativeTheme::kWindowResizeGripper,
+ ui::NativeTheme::kNormal,
+ size_box_bounds_,
+ extra);
#else
NOTIMPLEMENTED();
// TODO(port): paint size box
diff --git a/webkit/glue/webthemeengine_impl_android.cc b/webkit/glue/webthemeengine_impl_android.cc
index efa3675..30b3e76 100644
--- a/webkit/glue/webthemeengine_impl_android.cc
+++ b/webkit/glue/webthemeengine_impl_android.cc
@@ -8,7 +8,7 @@
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
using WebKit::WebCanvas;
using WebKit::WebColor;
@@ -17,69 +17,69 @@ using WebKit::WebThemeEngine;
namespace webkit_glue {
-static gfx::NativeTheme::Part NativeThemePart(
+static ui::NativeTheme::Part NativeThemePart(
WebThemeEngine::Part part) {
switch (part) {
case WebThemeEngine::PartScrollbarDownArrow:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
case WebThemeEngine::PartScrollbarLeftArrow:
- return gfx::NativeTheme::kScrollbarLeftArrow;
+ return ui::NativeTheme::kScrollbarLeftArrow;
case WebThemeEngine::PartScrollbarRightArrow:
- return gfx::NativeTheme::kScrollbarRightArrow;
+ return ui::NativeTheme::kScrollbarRightArrow;
case WebThemeEngine::PartScrollbarUpArrow:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
case WebThemeEngine::PartScrollbarHorizontalThumb:
// Android doesn't draw scrollbars.
NOTREACHED();
- return static_cast<gfx::NativeTheme::Part>(0);
+ return static_cast<ui::NativeTheme::Part>(0);
case WebThemeEngine::PartScrollbarVerticalThumb:
// Android doesn't draw scrollbars.
NOTREACHED();
- return static_cast<gfx::NativeTheme::Part>(0);
+ return static_cast<ui::NativeTheme::Part>(0);
case WebThemeEngine::PartScrollbarHorizontalTrack:
// Android doesn't draw scrollbars.
NOTREACHED();
- return static_cast<gfx::NativeTheme::Part>(0);
+ return static_cast<ui::NativeTheme::Part>(0);
case WebThemeEngine::PartScrollbarVerticalTrack:
// Android doesn't draw scrollbars.
NOTREACHED();
- return static_cast<gfx::NativeTheme::Part>(0);
+ return static_cast<ui::NativeTheme::Part>(0);
case WebThemeEngine::PartCheckbox:
- return gfx::NativeTheme::kCheckbox;
+ return ui::NativeTheme::kCheckbox;
case WebThemeEngine::PartRadio:
- return gfx::NativeTheme::kRadio;
+ return ui::NativeTheme::kRadio;
case WebThemeEngine::PartButton:
- return gfx::NativeTheme::kPushButton;
+ return ui::NativeTheme::kPushButton;
case WebThemeEngine::PartTextField:
- return gfx::NativeTheme::kTextField;
+ return ui::NativeTheme::kTextField;
case WebThemeEngine::PartMenuList:
- return gfx::NativeTheme::kMenuList;
+ return ui::NativeTheme::kMenuList;
case WebThemeEngine::PartSliderTrack:
- return gfx::NativeTheme::kSliderTrack;
+ return ui::NativeTheme::kSliderTrack;
case WebThemeEngine::PartSliderThumb:
- return gfx::NativeTheme::kSliderThumb;
+ return ui::NativeTheme::kSliderThumb;
case WebThemeEngine::PartInnerSpinButton:
- return gfx::NativeTheme::kInnerSpinButton;
+ return ui::NativeTheme::kInnerSpinButton;
case WebThemeEngine::PartProgressBar:
- return gfx::NativeTheme::kProgressBar;
+ return ui::NativeTheme::kProgressBar;
default:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
}
}
-static gfx::NativeTheme::State NativeThemeState(
+static ui::NativeTheme::State NativeThemeState(
WebThemeEngine::State state) {
switch (state) {
case WebThemeEngine::StateDisabled:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
case WebThemeEngine::StateHover:
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
case WebThemeEngine::StateNormal:
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
case WebThemeEngine::StatePressed:
- return gfx::NativeTheme::kPressed;
+ return ui::NativeTheme::kPressed;
default:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
}
}
@@ -87,7 +87,7 @@ static void GetNativeThemeExtraParams(
WebThemeEngine::Part part,
WebThemeEngine::State state,
const WebThemeEngine::ExtraParams* extra_params,
- gfx::NativeTheme::ExtraParams* native_theme_extra_params) {
+ ui::NativeTheme::ExtraParams* native_theme_extra_params) {
switch (part) {
case WebThemeEngine::PartScrollbarHorizontalTrack:
case WebThemeEngine::PartScrollbarVerticalTrack:
@@ -160,9 +160,9 @@ static void GetNativeThemeExtraParams(
}
WebKit::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) {
- gfx::NativeTheme::ExtraParams extra;
- return gfx::NativeTheme::instance()->GetPartSize(
- NativeThemePart(part), gfx::NativeTheme::kNormal, extra);
+ ui::NativeTheme::ExtraParams extra;
+ return ui::NativeTheme::instance()->GetPartSize(
+ NativeThemePart(part), ui::NativeTheme::kNormal, extra);
}
void WebThemeEngineImpl::paint(
@@ -171,10 +171,10 @@ void WebThemeEngineImpl::paint(
WebThemeEngine::State state,
const WebKit::WebRect& rect,
const WebThemeEngine::ExtraParams* extra_params) {
- gfx::NativeTheme::ExtraParams native_theme_extra_params;
+ ui::NativeTheme::ExtraParams native_theme_extra_params;
GetNativeThemeExtraParams(
part, state, extra_params, &native_theme_extra_params);
- gfx::NativeTheme::instance()->Paint(
+ ui::NativeTheme::instance()->Paint(
canvas,
NativeThemePart(part),
NativeThemeState(state),
diff --git a/webkit/glue/webthemeengine_impl_linux.cc b/webkit/glue/webthemeengine_impl_linux.cc
index 4a23959..8bd81f4 100644
--- a/webkit/glue/webthemeengine_impl_linux.cc
+++ b/webkit/glue/webthemeengine_impl_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -7,7 +7,7 @@
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
using WebKit::WebCanvas;
using WebKit::WebColor;
@@ -16,61 +16,61 @@ using WebKit::WebThemeEngine;
namespace webkit_glue {
-static gfx::NativeTheme::Part NativeThemePart(
+static ui::NativeTheme::Part NativeThemePart(
WebThemeEngine::Part part) {
switch (part) {
case WebThemeEngine::PartScrollbarDownArrow:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
case WebThemeEngine::PartScrollbarLeftArrow:
- return gfx::NativeTheme::kScrollbarLeftArrow;
+ return ui::NativeTheme::kScrollbarLeftArrow;
case WebThemeEngine::PartScrollbarRightArrow:
- return gfx::NativeTheme::kScrollbarRightArrow;
+ return ui::NativeTheme::kScrollbarRightArrow;
case WebThemeEngine::PartScrollbarUpArrow:
- return gfx::NativeTheme::kScrollbarUpArrow;
+ return ui::NativeTheme::kScrollbarUpArrow;
case WebThemeEngine::PartScrollbarHorizontalThumb:
- return gfx::NativeTheme::kScrollbarHorizontalThumb;
+ return ui::NativeTheme::kScrollbarHorizontalThumb;
case WebThemeEngine::PartScrollbarVerticalThumb:
- return gfx::NativeTheme::kScrollbarVerticalThumb;
+ return ui::NativeTheme::kScrollbarVerticalThumb;
case WebThemeEngine::PartScrollbarHorizontalTrack:
- return gfx::NativeTheme::kScrollbarHorizontalTrack;
+ return ui::NativeTheme::kScrollbarHorizontalTrack;
case WebThemeEngine::PartScrollbarVerticalTrack:
- return gfx::NativeTheme::kScrollbarVerticalTrack;
+ return ui::NativeTheme::kScrollbarVerticalTrack;
case WebThemeEngine::PartCheckbox:
- return gfx::NativeTheme::kCheckbox;
+ return ui::NativeTheme::kCheckbox;
case WebThemeEngine::PartRadio:
- return gfx::NativeTheme::kRadio;
+ return ui::NativeTheme::kRadio;
case WebThemeEngine::PartButton:
- return gfx::NativeTheme::kPushButton;
+ return ui::NativeTheme::kPushButton;
case WebThemeEngine::PartTextField:
- return gfx::NativeTheme::kTextField;
+ return ui::NativeTheme::kTextField;
case WebThemeEngine::PartMenuList:
- return gfx::NativeTheme::kMenuList;
+ return ui::NativeTheme::kMenuList;
case WebThemeEngine::PartSliderTrack:
- return gfx::NativeTheme::kSliderTrack;
+ return ui::NativeTheme::kSliderTrack;
case WebThemeEngine::PartSliderThumb:
- return gfx::NativeTheme::kSliderThumb;
+ return ui::NativeTheme::kSliderThumb;
case WebThemeEngine::PartInnerSpinButton:
- return gfx::NativeTheme::kInnerSpinButton;
+ return ui::NativeTheme::kInnerSpinButton;
case WebThemeEngine::PartProgressBar:
- return gfx::NativeTheme::kProgressBar;
+ return ui::NativeTheme::kProgressBar;
default:
- return gfx::NativeTheme::kScrollbarDownArrow;
+ return ui::NativeTheme::kScrollbarDownArrow;
}
}
-static gfx::NativeTheme::State NativeThemeState(
+static ui::NativeTheme::State NativeThemeState(
WebThemeEngine::State state) {
switch (state) {
case WebThemeEngine::StateDisabled:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
case WebThemeEngine::StateHover:
- return gfx::NativeTheme::kHovered;
+ return ui::NativeTheme::kHovered;
case WebThemeEngine::StateNormal:
- return gfx::NativeTheme::kNormal;
+ return ui::NativeTheme::kNormal;
case WebThemeEngine::StatePressed:
- return gfx::NativeTheme::kPressed;
+ return ui::NativeTheme::kPressed;
default:
- return gfx::NativeTheme::kDisabled;
+ return ui::NativeTheme::kDisabled;
}
}
@@ -78,7 +78,7 @@ static void GetNativeThemeExtraParams(
WebThemeEngine::Part part,
WebThemeEngine::State state,
const WebThemeEngine::ExtraParams* extra_params,
- gfx::NativeTheme::ExtraParams* native_theme_extra_params) {
+ ui::NativeTheme::ExtraParams* native_theme_extra_params) {
switch (part) {
case WebThemeEngine::PartScrollbarHorizontalTrack:
case WebThemeEngine::PartScrollbarVerticalTrack:
@@ -157,9 +157,9 @@ static void GetNativeThemeExtraParams(
}
WebKit::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) {
- gfx::NativeTheme::ExtraParams extra;
- return gfx::NativeTheme::instance()->GetPartSize(NativeThemePart(part),
- gfx::NativeTheme::kNormal,
+ ui::NativeTheme::ExtraParams extra;
+ return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part),
+ ui::NativeTheme::kNormal,
extra);
}
@@ -169,10 +169,10 @@ void WebThemeEngineImpl::paint(
WebThemeEngine::State state,
const WebKit::WebRect& rect,
const WebThemeEngine::ExtraParams* extra_params) {
- gfx::NativeTheme::ExtraParams native_theme_extra_params;
+ ui::NativeTheme::ExtraParams native_theme_extra_params;
GetNativeThemeExtraParams(
part, state, extra_params, &native_theme_extra_params);
- gfx::NativeTheme::instance()->Paint(
+ ui::NativeTheme::instance()->Paint(
canvas,
NativeThemePart(part),
NativeThemeState(state),
diff --git a/webkit/glue/webthemeengine_impl_win.cc b/webkit/glue/webthemeengine_impl_win.cc
index f90b158..d717b32 100644
--- a/webkit/glue/webthemeengine_impl_win.cc
+++ b/webkit/glue/webthemeengine_impl_win.cc
@@ -1,16 +1,16 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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 "webkit/glue/webthemeengine_impl_win.h"
-#include <vsstyle.h> // To convert to gfx::NativeTheme::State
+#include <vsstyle.h> // To convert to ui::NativeTheme::State
#include "base/logging.h"
#include "skia/ext/platform_canvas.h"
#include "skia/ext/skia_utils_win.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
-#include "ui/gfx/native_theme.h"
+#include "ui/base/native_theme/native_theme.h"
using WebKit::WebCanvas;
using WebKit::WebColor;
@@ -27,44 +27,44 @@ static RECT WebRectToRECT(const WebRect& rect) {
return result;
}
-static gfx::NativeTheme::State WebButtonStateToGfx(
- int part, int state, gfx::NativeTheme::ButtonExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebButtonStateToGfx(
+ int part, int state, ui::NativeTheme::ButtonExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
if (part == BP_PUSHBUTTON) {
switch (state) {
case PBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case PBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case PBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case PBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case PBS_DEFAULTED:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = true;
break;
case PBS_DEFAULTED_ANIMATING:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = true;
@@ -75,49 +75,49 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
} else if (part == BP_RADIOBUTTON) {
switch (state) {
case RBS_UNCHECKEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_UNCHECKEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_UNCHECKEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_UNCHECKEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_CHECKEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_CHECKEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_CHECKEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case RBS_CHECKEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
@@ -129,121 +129,121 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
} else if (part == BP_CHECKBOX) {
switch (state) {
case CBS_UNCHECKEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_UNCHECKEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_UNCHECKEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_UNCHECKEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_CHECKEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_CHECKEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_CHECKEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_CHECKEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = true;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_MIXEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = true;
extra->is_default = false;
break;
case CBS_MIXEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = true;
extra->is_default = false;
break;
case CBS_MIXEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = true;
extra->is_default = false;
break;
case CBS_MIXEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = true;
extra->is_default = false;
break;
case CBS_IMPLICITNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_IMPLICITHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_IMPLICITPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_IMPLICITDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_EXCLUDEDNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_EXCLUDEDHOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_EXCLUDEDPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CBS_EXCLUDEDDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
@@ -255,13 +255,13 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
} else if (part == BP_GROUPBOX) {
switch (state) {
case GBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case GBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
@@ -273,37 +273,37 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
} else if (part == BP_COMMANDLINK) {
switch (state) {
case CMDLS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLS_DEFAULTED:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = true;
break;
case CMDLS_DEFAULTED_ANIMATING:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = true;
@@ -315,31 +315,31 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
} else if (part == BP_COMMANDLINKGLYPH) {
switch (state) {
case CMDLGS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLGS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLGS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLGS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = false;
break;
case CMDLGS_DEFAULTED:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->checked = false;
extra->indeterminate = false;
extra->is_default = true;
@@ -355,47 +355,47 @@ static gfx::NativeTheme::State WebButtonStateToGfx(
void WebThemeEngineImpl::paintButton(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- gfx::NativeTheme::Part native_part = gfx::NativeTheme::kPushButton;
+ ui::NativeTheme::Part native_part = ui::NativeTheme::kPushButton;
switch (part) {
case BP_PUSHBUTTON:
- native_part = gfx::NativeTheme::kPushButton;
+ native_part = ui::NativeTheme::kPushButton;
break;
case BP_CHECKBOX:
- native_part = gfx::NativeTheme::kCheckbox;
+ native_part = ui::NativeTheme::kCheckbox;
break;
case BP_RADIOBUTTON:
- native_part = gfx::NativeTheme::kRadio;
+ native_part = ui::NativeTheme::kRadio;
break;
default:
NOTREACHED() << "Invalid part: " << part;
break;
}
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebButtonStateToGfx(part, state,
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebButtonStateToGfx(part, state,
&extra.button);
extra.button.classic_state = classic_state;
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebListMenuStateToGfx(int part, int state) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebListMenuStateToGfx(int part, int state) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (part) {
case CP_DROPDOWNBUTTON:
switch (state) {
case CBXS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
break;
case CBXS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
break;
case CBXS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
break;
case CBXS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
break;
default:
NOTREACHED() << "Invalid state: " << state;
@@ -412,126 +412,126 @@ static gfx::NativeTheme::State WebListMenuStateToGfx(int part, int state) {
void WebThemeEngineImpl::paintMenuList(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- gfx::NativeTheme::Part native_part = gfx::NativeTheme::kMenuList;
+ ui::NativeTheme::Part native_part = ui::NativeTheme::kMenuList;
switch (part) {
case CP_DROPDOWNBUTTON:
- native_part = gfx::NativeTheme::kMenuList;
+ native_part = ui::NativeTheme::kMenuList;
break;
default:
NOTREACHED() << "Invalid part: " << part;
break;
}
- gfx::NativeTheme::State native_state = WebListMenuStateToGfx(part, state);
+ ui::NativeTheme::State native_state = WebListMenuStateToGfx(part, state);
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::ExtraParams extra;
extra.menu_list.classic_state = classic_state;
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebScrollbarArrowStateToGfx(
- int state, gfx::NativeTheme::Part* part,
- gfx::NativeTheme::ScrollbarArrowExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebScrollbarArrowStateToGfx(
+ int state, ui::NativeTheme::Part* part,
+ ui::NativeTheme::ScrollbarArrowExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (state) {
case ABS_UPNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *part = gfx::NativeTheme::kScrollbarUpArrow;
+ gfx_state = ui::NativeTheme::kNormal;
+ *part = ui::NativeTheme::kScrollbarUpArrow;
extra->is_hovering = false;
break;
case ABS_UPHOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarUpArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarUpArrow;
extra->is_hovering = false;
break;
case ABS_UPPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *part = gfx::NativeTheme::kScrollbarUpArrow;
+ gfx_state = ui::NativeTheme::kPressed;
+ *part = ui::NativeTheme::kScrollbarUpArrow;
extra->is_hovering = false;
break;
case ABS_UPDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *part = gfx::NativeTheme::kScrollbarUpArrow;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *part = ui::NativeTheme::kScrollbarUpArrow;
extra->is_hovering = false;
break;
case ABS_DOWNNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *part = gfx::NativeTheme::kScrollbarDownArrow;
+ gfx_state = ui::NativeTheme::kNormal;
+ *part = ui::NativeTheme::kScrollbarDownArrow;
extra->is_hovering = false;
break;
case ABS_DOWNHOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarDownArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarDownArrow;
extra->is_hovering = false;
break;
case ABS_DOWNPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *part = gfx::NativeTheme::kScrollbarDownArrow;
+ gfx_state = ui::NativeTheme::kPressed;
+ *part = ui::NativeTheme::kScrollbarDownArrow;
extra->is_hovering = false;
break;
case ABS_DOWNDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *part = gfx::NativeTheme::kScrollbarDownArrow;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *part = ui::NativeTheme::kScrollbarDownArrow;
extra->is_hovering = false;
break;
case ABS_LEFTNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *part = gfx::NativeTheme::kScrollbarLeftArrow;
+ gfx_state = ui::NativeTheme::kNormal;
+ *part = ui::NativeTheme::kScrollbarLeftArrow;
extra->is_hovering = false;
break;
case ABS_LEFTHOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarLeftArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarLeftArrow;
extra->is_hovering = false;
break;
case ABS_LEFTPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *part = gfx::NativeTheme::kScrollbarLeftArrow;
+ gfx_state = ui::NativeTheme::kPressed;
+ *part = ui::NativeTheme::kScrollbarLeftArrow;
extra->is_hovering = false;
break;
case ABS_LEFTDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *part = gfx::NativeTheme::kScrollbarLeftArrow;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *part = ui::NativeTheme::kScrollbarLeftArrow;
extra->is_hovering = false;
break;
case ABS_RIGHTNORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *part = gfx::NativeTheme::kScrollbarRightArrow;
+ gfx_state = ui::NativeTheme::kNormal;
+ *part = ui::NativeTheme::kScrollbarRightArrow;
extra->is_hovering = false;
break;
case ABS_RIGHTHOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarRightArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarRightArrow;
extra->is_hovering = false;
break;
case ABS_RIGHTPRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *part = gfx::NativeTheme::kScrollbarRightArrow;
+ gfx_state = ui::NativeTheme::kPressed;
+ *part = ui::NativeTheme::kScrollbarRightArrow;
extra->is_hovering = false;
break;
case ABS_RIGHTDISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *part = gfx::NativeTheme::kScrollbarRightArrow;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *part = ui::NativeTheme::kScrollbarRightArrow;
extra->is_hovering = false;
break;
case ABS_UPHOVER:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarUpArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarUpArrow;
extra->is_hovering = true;
break;
case ABS_DOWNHOVER:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarDownArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarDownArrow;
extra->is_hovering = true;
break;
case ABS_LEFTHOVER:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarLeftArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarLeftArrow;
extra->is_hovering = true;
break;
case ABS_RIGHTHOVER:
- gfx_state = gfx::NativeTheme::kHovered;
- *part = gfx::NativeTheme::kScrollbarRightArrow;
+ gfx_state = ui::NativeTheme::kHovered;
+ *part = ui::NativeTheme::kScrollbarRightArrow;
extra->is_hovering = true;
break;
default:
@@ -543,37 +543,37 @@ static gfx::NativeTheme::State WebScrollbarArrowStateToGfx(
void WebThemeEngineImpl::paintScrollbarArrow(
WebCanvas* canvas, int state, int classic_state, const WebRect& rect) {
- gfx::NativeTheme::Part native_part;
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebScrollbarArrowStateToGfx(
+ ui::NativeTheme::Part native_part;
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebScrollbarArrowStateToGfx(
state, &native_part, &extra.scrollbar_arrow);
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebScrollbarThumbStateToGfx(
- int state, gfx::NativeTheme::ScrollbarThumbExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebScrollbarThumbStateToGfx(
+ int state, ui::NativeTheme::ScrollbarThumbExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (state) {
case SCRBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->is_hovering = false;
break;
case SCRBS_HOVER:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->is_hovering = true;
break;
case SCRBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->is_hovering = false;
break;
case SCRBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->is_hovering = false;
break;
case SCRBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->is_hovering = false;
break;
default:
@@ -586,54 +586,54 @@ static gfx::NativeTheme::State WebScrollbarThumbStateToGfx(
void WebThemeEngineImpl::paintScrollbarThumb(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- gfx::NativeTheme::Part native_part;
+ ui::NativeTheme::Part native_part;
if (part == SBP_THUMBBTNHORZ) {
- native_part = gfx::NativeTheme::kScrollbarHorizontalThumb;
+ native_part = ui::NativeTheme::kScrollbarHorizontalThumb;
} else if (part == SBP_THUMBBTNVERT) {
- native_part = gfx::NativeTheme::kScrollbarVerticalThumb;
+ native_part = ui::NativeTheme::kScrollbarVerticalThumb;
} else if (part == SBP_GRIPPERHORZ) {
- native_part = gfx::NativeTheme::kScrollbarHorizontalGripper;
+ native_part = ui::NativeTheme::kScrollbarHorizontalGripper;
} else if (part == SBP_GRIPPERVERT) {
- native_part = gfx::NativeTheme::kScrollbarVerticalGripper;
+ native_part = ui::NativeTheme::kScrollbarVerticalGripper;
} else {
NOTREACHED() << "Invalid part: " << part;
}
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebScrollbarThumbStateToGfx(
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebScrollbarThumbStateToGfx(
state, &extra.scrollbar_thumb);
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebScrollbarTrackStateToGfx(
- int part, int state, gfx::NativeTheme::Part* gfx_part,
- gfx::NativeTheme::ScrollbarTrackExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebScrollbarTrackStateToGfx(
+ int part, int state, ui::NativeTheme::Part* gfx_part,
+ ui::NativeTheme::ScrollbarTrackExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (part) {
case SBP_LOWERTRACKHORZ:
switch (state) {
case SCRBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kNormal;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = false;
break;
case SCRBS_HOVER:
case SCRBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kHovered;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = false;
break;
case SCRBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kPressed;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = false;
break;
case SCRBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = false;
break;
default:
@@ -644,24 +644,24 @@ static gfx::NativeTheme::State WebScrollbarTrackStateToGfx(
case SBP_UPPERTRACKHORZ:
switch (state) {
case SCRBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kNormal;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = true;
break;
case SCRBS_HOVER:
case SCRBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kHovered;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = true;
break;
case SCRBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kPressed;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = true;
break;
case SCRBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *gfx_part = gfx::NativeTheme::kScrollbarHorizontalTrack;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *gfx_part = ui::NativeTheme::kScrollbarHorizontalTrack;
extra->is_upper = true;
break;
default:
@@ -672,24 +672,24 @@ static gfx::NativeTheme::State WebScrollbarTrackStateToGfx(
case SBP_LOWERTRACKVERT:
switch (state) {
case SCRBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kNormal;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = false;
break;
case SCRBS_HOVER:
case SCRBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kHovered;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = false;
break;
case SCRBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kPressed;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = false;
break;
case SCRBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = false;
break;
default:
@@ -700,24 +700,24 @@ static gfx::NativeTheme::State WebScrollbarTrackStateToGfx(
case SBP_UPPERTRACKVERT:
switch (state) {
case SCRBS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kNormal;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = true;
break;
case SCRBS_HOVER:
case SCRBS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kHovered;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = true;
break;
case SCRBS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kPressed;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = true;
break;
case SCRBS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
- *gfx_part = gfx::NativeTheme::kScrollbarVerticalTrack;
+ gfx_state = ui::NativeTheme::kDisabled;
+ *gfx_part = ui::NativeTheme::kScrollbarVerticalTrack;
extra->is_upper = true;
break;
default:
@@ -735,9 +735,9 @@ static gfx::NativeTheme::State WebScrollbarTrackStateToGfx(
void WebThemeEngineImpl::paintScrollbarTrack(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect, const WebRect& align_rect) {
- gfx::NativeTheme::Part native_part;
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebScrollbarTrackStateToGfx(
+ ui::NativeTheme::Part native_part;
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebScrollbarTrackStateToGfx(
part, state, &native_part, &extra.scrollbar_track);
extra.scrollbar_track.classic_state = classic_state;
extra.scrollbar_track.track_x = align_rect.x;
@@ -746,33 +746,33 @@ void WebThemeEngineImpl::paintScrollbarTrack(
extra.scrollbar_track.track_height = align_rect.height;
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebSpinButtonStateToGfx(
- int part, int state, gfx::NativeTheme::InnerSpinButtonExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebSpinButtonStateToGfx(
+ int part, int state, ui::NativeTheme::InnerSpinButtonExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (part) {
case SPNP_UP:
switch (state) {
case UPS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->spin_up = true;
extra->read_only = false;
break;
case UPS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->spin_up = true;
extra->read_only = false;
break;
case UPS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->spin_up = true;
extra->read_only = false;
break;
case UPS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->spin_up = true;
extra->read_only = false;
break;
@@ -784,22 +784,22 @@ static gfx::NativeTheme::State WebSpinButtonStateToGfx(
case SPNP_DOWN:
switch (state) {
case DNS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->spin_up = false;
extra->read_only = false;
break;
case DNS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->spin_up = false;
extra->read_only = false;
break;
case DNS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->spin_up = false;
extra->read_only = false;
break;
case DNS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->spin_up = false;
extra->read_only = false;
break;
@@ -818,51 +818,51 @@ static gfx::NativeTheme::State WebSpinButtonStateToGfx(
void WebThemeEngineImpl::paintSpinButton(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebSpinButtonStateToGfx(
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebSpinButtonStateToGfx(
part, state, &extra.inner_spin);
extra.inner_spin.classic_state = classic_state;
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas,
- gfx::NativeTheme::kInnerSpinButton,
+ ui::NativeTheme::instance()->Paint(canvas,
+ ui::NativeTheme::kInnerSpinButton,
native_state,
gfx_rect,
extra);
}
-static gfx::NativeTheme::State WebTextFieldStateToGfx(
- int part, int state, gfx::NativeTheme::TextFieldExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+static ui::NativeTheme::State WebTextFieldStateToGfx(
+ int part, int state, ui::NativeTheme::TextFieldExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (part) {
case EP_EDITTEXT:
switch (state) {
case ETS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->is_read_only = false;
extra->is_focused = false;
break;
case ETS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
extra->is_read_only = false;
extra->is_focused = false;
break;
case ETS_SELECTED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
extra->is_read_only = false;
extra->is_focused = false;
break;
case ETS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
extra->is_read_only = false;
extra->is_focused = false;
break;
case ETS_FOCUSED:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->is_read_only = false;
extra->is_focused = true;
break;
case ETS_READONLY:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
extra->is_read_only = true;
extra->is_focused = false;
break;
@@ -882,8 +882,8 @@ void WebThemeEngineImpl::paintTextField(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect, WebColor color, bool fill_content_area,
bool draw_edges) {
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebTextFieldStateToGfx(
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebTextFieldStateToGfx(
part, state, &extra.text_field);
extra.text_field.fill_content_area = fill_content_area;
extra.text_field.draw_edges = draw_edges;
@@ -891,27 +891,27 @@ void WebThemeEngineImpl::paintTextField(
extra.text_field.classic_state = classic_state;
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
- gfx::NativeTheme::instance()->Paint(canvas,
- gfx::NativeTheme::kTextField, native_state, gfx_rect, extra);
+ ui::NativeTheme::instance()->Paint(canvas,
+ ui::NativeTheme::kTextField, native_state, gfx_rect, extra);
}
-static gfx::NativeTheme::State WebTrackbarStateToGfx(
+static ui::NativeTheme::State WebTrackbarStateToGfx(
int part,
int state,
- gfx::NativeTheme::TrackbarExtraParams* extra) {
- gfx::NativeTheme::State gfx_state = gfx::NativeTheme::kNormal;
+ ui::NativeTheme::TrackbarExtraParams* extra) {
+ ui::NativeTheme::State gfx_state = ui::NativeTheme::kNormal;
switch (state) {
case TUS_NORMAL:
- gfx_state = gfx::NativeTheme::kNormal;
+ gfx_state = ui::NativeTheme::kNormal;
break;
case TUS_HOT:
- gfx_state = gfx::NativeTheme::kHovered;
+ gfx_state = ui::NativeTheme::kHovered;
break;
case TUS_PRESSED:
- gfx_state = gfx::NativeTheme::kPressed;
+ gfx_state = ui::NativeTheme::kPressed;
break;
case TUS_DISABLED:
- gfx_state = gfx::NativeTheme::kDisabled;
+ gfx_state = ui::NativeTheme::kDisabled;
break;
default:
NOTREACHED() << "Invalid state: " << state;
@@ -938,27 +938,27 @@ static gfx::NativeTheme::State WebTrackbarStateToGfx(
void WebThemeEngineImpl::paintTrackbar(
WebCanvas* canvas, int part, int state, int classic_state,
const WebRect& rect) {
- gfx::NativeTheme::Part native_part = gfx::NativeTheme::kTrackbarTrack;
+ ui::NativeTheme::Part native_part = ui::NativeTheme::kTrackbarTrack;
switch (part) {
case TKP_TRACK:
case TKP_TRACKVERT:
- native_part = gfx::NativeTheme::kTrackbarTrack;
+ native_part = ui::NativeTheme::kTrackbarTrack;
break;
case TKP_THUMBBOTTOM:
case TKP_THUMBVERT:
- native_part = gfx::NativeTheme::kTrackbarThumb;
+ native_part = ui::NativeTheme::kTrackbarThumb;
break;
default:
NOTREACHED() << "Invalid part: " << part;
break;
}
- gfx::NativeTheme::ExtraParams extra;
- gfx::NativeTheme::State native_state = WebTrackbarStateToGfx(part, state,
+ ui::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::State native_state = WebTrackbarStateToGfx(part, state,
&extra.trackbar);
gfx::Rect gfx_rect(rect.x, rect.y, rect.width, rect.height);
extra.trackbar.classic_state = classic_state;
- gfx::NativeTheme::instance()->Paint(canvas, native_part,
+ ui::NativeTheme::instance()->Paint(canvas, native_part,
native_state, gfx_rect, extra);
}
@@ -967,15 +967,15 @@ void WebThemeEngineImpl::paintProgressBar(
bool determinate, double animatedSeconds)
{
gfx::Rect gfx_rect(barRect.x, barRect.y, barRect.width, barRect.height);
- gfx::NativeTheme::ExtraParams extra;
+ ui::NativeTheme::ExtraParams extra;
extra.progress_bar.animated_seconds = animatedSeconds;
extra.progress_bar.determinate = determinate;
extra.progress_bar.value_rect_x = valueRect.x;
extra.progress_bar.value_rect_y = valueRect.y;
extra.progress_bar.value_rect_width = valueRect.width;
extra.progress_bar.value_rect_height = valueRect.height;
- gfx::NativeTheme::instance()->Paint(canvas, gfx::NativeTheme::kProgressBar,
- gfx::NativeTheme::kNormal, gfx_rect,
+ ui::NativeTheme::instance()->Paint(canvas, ui::NativeTheme::kProgressBar,
+ ui::NativeTheme::kNormal, gfx_rect,
extra);
}
diff --git a/webkit/tools/test_shell/test_shell_platform_delegate_win.cc b/webkit/tools/test_shell/test_shell_platform_delegate_win.cc
index ad1c1e3..9125822 100644
--- a/webkit/tools/test_shell/test_shell_platform_delegate_win.cc
+++ b/webkit/tools/test_shell/test_shell_platform_delegate_win.cc
@@ -2,16 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <string>
-#include <list>
#include <windows.h>
#include <commctrl.h>
+#include <list>
+#include <string>
+
#include "base/command_line.h"
#include "base/event_recorder.h"
#include "base/win/win_util.h"
+#include "ui/base/native_theme/native_theme_win.h"
#include "ui/base/win/foreground_helper.h"
-#include "ui/gfx/native_theme_win.h"
#include "webkit/tools/test_shell/test_shell.h"
#include "webkit/tools/test_shell/test_shell_platform_delegate.h"
@@ -140,7 +141,7 @@ void TestShellPlatformDelegate::InitializeGUI() {
}
void TestShellPlatformDelegate::SelectUnifiedTheme() {
- gfx::NativeThemeWin::instance()->DisableTheming();
+ ui::NativeThemeWin::instance()->DisableTheming();
}
void TestShellPlatformDelegate::SetWindowPositionForRecording(