summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 19:02:16 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 19:02:16 +0000
commitc6d9422188208e9034891c3cb46d37171e33208c (patch)
tree82dd7b79d7b1ff2b67f7bf55eedc360e87084a37 /views
parentb00bbb39365d95b4e8d95302d1e18507997fd1ec (diff)
downloadchromium_src-c6d9422188208e9034891c3cb46d37171e33208c.zip
chromium_src-c6d9422188208e9034891c3cb46d37171e33208c.tar.gz
chromium_src-c6d9422188208e9034891c3cb46d37171e33208c.tar.bz2
In preparation for NativeTheme refactoring, renaming the class NativeTheme
to NativeThemeWin, since it is windows specific anyway. BUG=None TEST=None R=xiyuan@chromium.org Review URL: http://codereview.chromium.org/6778009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/combobox/native_combobox_win.cc4
-rw-r--r--views/controls/menu/menu_config_win.cc28
-rw-r--r--views/controls/menu/menu_item_view.h2
-rw-r--r--views/controls/menu/menu_item_view_win.cc42
-rw-r--r--views/controls/menu/menu_scroll_view_container.cc10
-rw-r--r--views/controls/menu/menu_separator_win.cc4
-rw-r--r--views/controls/native_control.cc1
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_win.cc6
-rw-r--r--views/controls/textfield/native_textfield_win.cc6
-rw-r--r--views/widget/widget_win.cc4
-rw-r--r--views/window/dialog_client_view.cc6
11 files changed, 56 insertions, 57 deletions
diff --git a/views/controls/combobox/native_combobox_win.cc b/views/controls/combobox/native_combobox_win.cc
index ebb91b5..7190440 100644
--- a/views/controls/combobox/native_combobox_win.cc
+++ b/views/controls/combobox/native_combobox_win.cc
@@ -107,8 +107,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::NativeTheme::instance()->GetThemeBorderSize(
- gfx::NativeTheme::MENULIST);
+ gfx::Size border = gfx::NativeThemeWin::instance()->GetThemeBorderSize(
+ gfx::NativeThemeWin::MENULIST);
// The padding value of '3' is the xy offset from the corner of the control
// to the corner of rcItem. It does not seem to be queryable from the theme.
diff --git a/views/controls/menu/menu_config_win.cc b/views/controls/menu/menu_config_win.cc
index 8f1053d..0b4334c 100644
--- a/views/controls/menu/menu_config_win.cc
+++ b/views/controls/menu/menu_config_win.cc
@@ -13,7 +13,7 @@
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/gfx/native_theme_win.h"
-using gfx::NativeTheme;
+using gfx::NativeThemeWin;
namespace views {
@@ -21,8 +21,8 @@ namespace views {
MenuConfig* MenuConfig::Create() {
MenuConfig* config = new MenuConfig();
- config->text_color = NativeTheme::instance()->GetThemeColorWithDefault(
- NativeTheme::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR,
+ config->text_color = NativeThemeWin::instance()->GetThemeColorWithDefault(
+ NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR,
COLOR_MENUTEXT);
NONCLIENTMETRICS metrics;
@@ -35,9 +35,9 @@ MenuConfig* MenuConfig::Create() {
HDC dc = GetDC(NULL);
RECT bounds = { 0, 0, 200, 200 };
SIZE check_size;
- if (NativeTheme::instance()->GetThemePartSize(
- NativeTheme::MENU, dc, MENU_POPUPCHECK, MC_CHECKMARKNORMAL, &bounds,
- TS_TRUE, &check_size) == S_OK) {
+ if (NativeThemeWin::instance()->GetThemePartSize(
+ NativeThemeWin::MENU, dc, MENU_POPUPCHECK, MC_CHECKMARKNORMAL,
+ &bounds, TS_TRUE, &check_size) == S_OK) {
config->check_width = check_size.cx;
config->check_height = check_size.cy;
} else {
@@ -46,8 +46,8 @@ MenuConfig* MenuConfig::Create() {
}
SIZE radio_size;
- if (NativeTheme::instance()->GetThemePartSize(
- NativeTheme::MENU, dc, MENU_POPUPCHECK, MC_BULLETNORMAL, &bounds,
+ if (NativeThemeWin::instance()->GetThemePartSize(
+ NativeThemeWin::MENU, dc, MENU_POPUPCHECK, MC_BULLETNORMAL, &bounds,
TS_TRUE, &radio_size) == S_OK) {
config->radio_width = radio_size.cx;
config->radio_height = radio_size.cy;
@@ -57,8 +57,8 @@ MenuConfig* MenuConfig::Create() {
}
SIZE arrow_size;
- if (NativeTheme::instance()->GetThemePartSize(
- NativeTheme::MENU, dc, MENU_POPUPSUBMENU, MSM_NORMAL, &bounds,
+ if (NativeThemeWin::instance()->GetThemePartSize(
+ NativeThemeWin::MENU, dc, MENU_POPUPSUBMENU, MSM_NORMAL, &bounds,
TS_TRUE, &arrow_size) == S_OK) {
config->arrow_width = arrow_size.cx;
config->arrow_height = arrow_size.cy;
@@ -69,8 +69,8 @@ MenuConfig* MenuConfig::Create() {
}
SIZE gutter_size;
- if (NativeTheme::instance()->GetThemePartSize(
- NativeTheme::MENU, dc, MENU_POPUPGUTTER, MSM_NORMAL, &bounds,
+ if (NativeThemeWin::instance()->GetThemePartSize(
+ NativeThemeWin::MENU, dc, MENU_POPUPGUTTER, MSM_NORMAL, &bounds,
TS_TRUE, &gutter_size) == S_OK) {
config->gutter_width = gutter_size.cx;
config->render_gutter = true;
@@ -80,8 +80,8 @@ MenuConfig* MenuConfig::Create() {
}
SIZE separator_size;
- if (NativeTheme::instance()->GetThemePartSize(
- NativeTheme::MENU, dc, MENU_POPUPSEPARATOR, MSM_NORMAL, &bounds,
+ if (NativeThemeWin::instance()->GetThemePartSize(
+ NativeThemeWin::MENU, dc, MENU_POPUPSEPARATOR, MSM_NORMAL, &bounds,
TS_TRUE, &separator_size) == S_OK) {
config->separator_height = separator_size.cy;
} else {
diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h
index 73304cd..936f857 100644
--- a/views/controls/menu/menu_item_view.h
+++ b/views/controls/menu/menu_item_view.h
@@ -336,7 +336,7 @@ class MenuItemView : public View {
// native theme drawing routines.
void PaintCheck(HDC dc,
int part_id,
- gfx::NativeTheme::ControlState control_state,
+ gfx::NativeThemeWin::ControlState control_state,
int icon_width,
int icon_height);
#endif
diff --git a/views/controls/menu/menu_item_view_win.cc b/views/controls/menu/menu_item_view_win.cc
index d746855..41fdad8 100644
--- a/views/controls/menu/menu_item_view_win.cc
+++ b/views/controls/menu/menu_item_view_win.cc
@@ -13,7 +13,7 @@
#include "views/controls/menu/menu_config.h"
#include "views/controls/menu/submenu_view.h"
-using gfx::NativeTheme;
+using gfx::NativeThemeWin;
namespace views {
@@ -34,13 +34,13 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
int state = render_selection ? MPI_HOT :
(IsEnabled() ? MPI_NORMAL : MPI_DISABLED);
HDC dc = canvas->BeginPlatformPaint();
- NativeTheme::ControlState control_state;
+ NativeThemeWin::ControlState control_state;
if (!IsEnabled()) {
- control_state = NativeTheme::CONTROL_DISABLED;
+ control_state = NativeThemeWin::CONTROL_DISABLED;
} else {
- control_state = render_selection ? NativeTheme::CONTROL_HIGHLIGHTED :
- NativeTheme::CONTROL_NORMAL;
+ control_state = render_selection ? NativeThemeWin::CONTROL_HIGHLIGHTED :
+ NativeThemeWin::CONTROL_NORMAL;
}
// The gutter is rendered before the background.
@@ -50,8 +50,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
height());
AdjustBoundsForRTLUI(&gutter_bounds);
RECT gutter_rect = gutter_bounds.ToRECT();
- NativeTheme::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER, MPI_NORMAL,
- &gutter_rect);
+ NativeThemeWin::instance()->PaintMenuGutter(dc, MENU_POPUPGUTTER,
+ MPI_NORMAL, &gutter_rect);
}
// Render the background.
@@ -59,8 +59,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
gfx::Rect item_bounds(0, 0, width(), height());
AdjustBoundsForRTLUI(&item_bounds);
RECT item_rect = item_bounds.ToRECT();
- NativeTheme::instance()->PaintMenuItemBackground(
- NativeTheme::MENU, dc, MENU_POPUPITEM, state, render_selection,
+ NativeThemeWin::instance()->PaintMenuItemBackground(
+ NativeThemeWin::MENU, dc, MENU_POPUPITEM, state, render_selection,
&item_rect);
}
@@ -81,8 +81,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
// get color.
int default_sys_color = render_selection ? COLOR_HIGHLIGHTTEXT :
(IsEnabled() ? COLOR_MENUTEXT : COLOR_GRAYTEXT);
- SkColor fg_color = NativeTheme::instance()->GetThemeColorWithDefault(
- NativeTheme::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
+ SkColor fg_color = NativeThemeWin::instance()->GetThemeColorWithDefault(
+ NativeThemeWin::MENU, MENU_POPUPITEM, state, TMT_TEXTCOLOR,
default_sys_color);
const gfx::Font& font = MenuConfig::instance().font;
int accel_width = parent_menu_item_->GetSubmenu()->max_accelerator_width();
@@ -127,15 +127,15 @@ 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.
- NativeTheme::MenuArrowDirection arrow_direction;
+ NativeThemeWin::MenuArrowDirection arrow_direction;
if (base::i18n::IsRTL())
- arrow_direction = NativeTheme::LEFT_POINTING_ARROW;
+ arrow_direction = NativeThemeWin::LEFT_POINTING_ARROW;
else
- arrow_direction = NativeTheme::RIGHT_POINTING_ARROW;
+ arrow_direction = NativeThemeWin::RIGHT_POINTING_ARROW;
RECT arrow_rect = arrow_bounds.ToRECT();
- NativeTheme::instance()->PaintMenuArrow(
- NativeTheme::MENU, dc, MENU_POPUPSUBMENU, state_id, &arrow_rect,
+ NativeThemeWin::instance()->PaintMenuArrow(
+ NativeThemeWin::MENU, dc, MENU_POPUPSUBMENU, state_id, &arrow_rect,
arrow_direction, control_state);
}
canvas->EndPlatformPaint();
@@ -143,7 +143,7 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
void MenuItemView::PaintCheck(HDC dc,
int state_id,
- NativeTheme::ControlState control_state,
+ NativeThemeWin::ControlState control_state,
int icon_width,
int icon_height) {
int top_margin = GetTopMargin();
@@ -155,16 +155,16 @@ void MenuItemView::PaintCheck(HDC dc,
int bg_state = IsEnabled() ? MCB_NORMAL : MCB_DISABLED;
AdjustBoundsForRTLUI(&bg_bounds);
RECT bg_rect = bg_bounds.ToRECT();
- NativeTheme::instance()->PaintMenuCheckBackground(
- NativeTheme::MENU, dc, MENU_POPUPCHECKBACKGROUND, bg_state,
+ NativeThemeWin::instance()->PaintMenuCheckBackground(
+ NativeThemeWin::MENU, dc, MENU_POPUPCHECKBACKGROUND, bg_state,
&bg_rect);
// And the check.
gfx::Rect icon_bounds(icon_x / 2, icon_y, icon_width, icon_height);
AdjustBoundsForRTLUI(&icon_bounds);
RECT icon_rect = icon_bounds.ToRECT();
- NativeTheme::instance()->PaintMenuCheck(
- NativeTheme::MENU, dc, MENU_POPUPCHECK, state_id, &icon_rect,
+ NativeThemeWin::instance()->PaintMenuCheck(
+ NativeThemeWin::MENU, dc, MENU_POPUPCHECK, state_id, &icon_rect,
control_state);
}
diff --git a/views/controls/menu/menu_scroll_view_container.cc b/views/controls/menu/menu_scroll_view_container.cc
index 0797522..94bd75b 100644
--- a/views/controls/menu/menu_scroll_view_container.cc
+++ b/views/controls/menu/menu_scroll_view_container.cc
@@ -25,7 +25,7 @@
#endif
#if defined(OS_WIN)
-using gfx::NativeTheme;
+using gfx::NativeThemeWin;
#endif
// Height of the scroll arrow.
@@ -88,8 +88,8 @@ class MenuScrollButton : public View {
// The background.
RECT item_bounds = { 0, 0, width(), height() };
- NativeTheme::instance()->PaintMenuItemBackground(
- NativeTheme::MENU, dc, MENU_POPUPITEM, MPI_NORMAL, false,
+ NativeThemeWin::instance()->PaintMenuItemBackground(
+ NativeThemeWin::MENU, dc, MENU_POPUPITEM, MPI_NORMAL, false,
&item_bounds);
canvas->EndPlatformPaint();
@@ -189,8 +189,8 @@ void MenuScrollViewContainer::OnPaintBackground(gfx::Canvas* canvas) {
#if defined(OS_WIN)
HDC dc = canvas->BeginPlatformPaint();
RECT bounds = {0, 0, width(), height()};
- NativeTheme::instance()->PaintMenuBackground(
- NativeTheme::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds);
+ NativeThemeWin::instance()->PaintMenuBackground(
+ NativeThemeWin::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds);
canvas->EndPlatformPaint();
#elif defined(OS_CHROMEOS)
static const SkColor kGradientColors[2] = {
diff --git a/views/controls/menu/menu_separator_win.cc b/views/controls/menu/menu_separator_win.cc
index b2f8a3e..d997dbd 100644
--- a/views/controls/menu/menu_separator_win.cc
+++ b/views/controls/menu/menu_separator_win.cc
@@ -21,9 +21,9 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
int start_x = 0;
int start_y = height() / 3 + 1; // +1 makes separator centered.
HDC dc = canvas->BeginPlatformPaint();
- const gfx::NativeTheme* theme = gfx::NativeTheme::instance();
+ const gfx::NativeThemeWin* theme = gfx::NativeThemeWin::instance();
// Delta is needed for non-classic to move separator up slightly.
- int delta = theme->IsClassicTheme(gfx::NativeTheme::MENU) ? 0 : 1;
+ int delta = theme->IsClassicTheme(gfx::NativeThemeWin::MENU) ? 0 : 1;
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.
diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc
index ebf668e..83a67e5 100644
--- a/views/controls/native_control.cc
+++ b/views/controls/native_control.cc
@@ -18,7 +18,6 @@
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/view_prop.h"
#include "ui/base/win/hwnd_util.h"
-#include "ui/gfx/native_theme_win.h"
#include "views/background.h"
#include "views/border.h"
#include "views/controls/native/native_view_host.h"
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc
index 333fff0..1b488528 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc
+++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc
@@ -29,8 +29,8 @@ class TabBackground : public Background {
// TMT_FILLCOLORHINT returns a color value that supposedly
// approximates the texture drawn by PaintTabPanelBackground.
SkColor tab_page_color =
- gfx::NativeTheme::instance()->GetThemeColorWithDefault(
- gfx::NativeTheme::TAB, TABP_BODY, 0, TMT_FILLCOLORHINT,
+ gfx::NativeThemeWin::instance()->GetThemeColorWithDefault(
+ gfx::NativeThemeWin::TAB, TABP_BODY, 0, TMT_FILLCOLORHINT,
COLOR_3DFACE);
SetNativeControlColor(tab_page_color);
}
@@ -39,7 +39,7 @@ class TabBackground : public Background {
virtual void Paint(gfx::Canvas* canvas, View* view) const {
HDC dc = canvas->BeginPlatformPaint();
RECT r = {0, 0, view->width(), view->height()};
- gfx::NativeTheme::instance()->PaintTabPanelBackground(dc, &r);
+ gfx::NativeThemeWin::instance()->PaintTabPanelBackground(dc, &r);
canvas->EndPlatformPaint();
}
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index f8b2ea2..a9e6ecb 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -871,9 +871,9 @@ void NativeTextfieldWin::OnNCPaint(HRGN region) {
int classic_state =
(!textfield_->IsEnabled() || textfield_->read_only()) ? DFCS_INACTIVE : 0;
- gfx::NativeTheme::instance()->PaintTextField(hdc, part, state, classic_state,
- &window_rect, bg_color_, false,
- true);
+ gfx::NativeThemeWin::instance()->PaintTextField(hdc, part, state,
+ classic_state, &window_rect,
+ bg_color_, false, true);
// NOTE: I tried checking the transparent property of the theme and invoking
// drawParentBackground, but it didn't seem to make a difference.
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index f57e43b..f50dfbc 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -943,8 +943,8 @@ void WidgetWin::OnSysCommand(UINT notification_code, CPoint click) {
}
void WidgetWin::OnThemeChanged() {
- // Notify NativeTheme.
- gfx::NativeTheme::instance()->CloseHandles();
+ // Notify NativeThemeWin.
+ gfx::NativeThemeWin::instance()->CloseHandles();
}
void WidgetWin::OnVScroll(int scroll_type, short position, HWND scrollbar) {
diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc
index 99512cb..2f08f96 100644
--- a/views/window/dialog_client_view.cc
+++ b/views/window/dialog_client_view.cc
@@ -429,8 +429,8 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
#if defined(OS_WIN)
HDC dc = canvas->BeginPlatformPaint();
SIZE gripper_size = { 0, 0 };
- gfx::NativeTheme::instance()->GetThemePartSize(
- gfx::NativeTheme::STATUS, dc, SP_GRIPPER, 1, NULL, TS_TRUE,
+ gfx::NativeThemeWin::instance()->GetThemePartSize(
+ gfx::NativeThemeWin::STATUS, dc, SP_GRIPPER, 1, NULL, TS_TRUE,
&gripper_size);
// TODO(beng): (http://b/1085509) In "classic" rendering mode, there isn't
@@ -441,7 +441,7 @@ void DialogClientView::PaintSizeBox(gfx::Canvas* canvas) {
size_box_bounds_.set_x(size_box_bounds_.right() - gripper_size.cx);
size_box_bounds_.set_y(size_box_bounds_.bottom() - gripper_size.cy);
RECT native_bounds = size_box_bounds_.ToRECT();
- gfx::NativeTheme::instance()->PaintStatusGripper(
+ gfx::NativeThemeWin::instance()->PaintStatusGripper(
dc, SP_PANE, 1, 0, &native_bounds);
canvas->EndPlatformPaint();
#else