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

Unified Diff: ui/views/controls/button/text_button.cc

Issue 10387121: Revert 136996 - ui: Move NativeTheme files into ui/base/native_theme/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/button/text_button.h ('k') | ui/views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.cc
===================================================================
--- ui/views/controls/button/text_button.cc (revision 137002)
+++ ui/views/controls/button/text_button.cc (working copy)
@@ -18,7 +18,7 @@
#if defined(OS_WIN)
#include "skia/ext/skia_utils_win.h"
-#include "ui/base/native_theme/native_theme_win.h"
+#include "ui/gfx/native_theme_win.h"
#include "ui/gfx/platform_font_win.h"
#endif
@@ -208,30 +208,30 @@
void TextButtonNativeThemeBorder::Paint(const View& view,
gfx::Canvas* canvas) const {
const TextButtonBase* tb = static_cast<const TextButton*>(&view);
- const ui::NativeTheme* native_theme = ui::NativeTheme::instance();
- ui::NativeTheme::Part part = delegate_->GetThemePart();
+ const gfx::NativeTheme* native_theme = gfx::NativeTheme::instance();
+ gfx::NativeTheme::Part part = delegate_->GetThemePart();
gfx::Rect rect(delegate_->GetThemePaintRect());
if (tb->show_multiple_icon_states() &&
delegate_->GetThemeAnimation() != NULL &&
delegate_->GetThemeAnimation()->is_animating()) {
// Paint background state.
- ui::NativeTheme::ExtraParams prev_extra;
- ui::NativeTheme::State prev_state =
+ gfx::NativeTheme::ExtraParams prev_extra;
+ gfx::NativeTheme::State prev_state =
delegate_->GetBackgroundThemeState(&prev_extra);
native_theme->Paint(canvas->sk_canvas(), part, prev_state, rect,
prev_extra);
// Composite foreground state above it.
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetForegroundThemeState(&extra);
int alpha = delegate_->GetThemeAnimation()->CurrentValueBetween(0, 255);
canvas->SaveLayerAlpha(static_cast<uint8>(alpha));
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
canvas->Restore();
} else {
- ui::NativeTheme::ExtraParams extra;
- ui::NativeTheme::State state = delegate_->GetThemeState(&extra);
+ gfx::NativeTheme::ExtraParams extra;
+ gfx::NativeTheme::State state = delegate_->GetThemeState(&extra);
native_theme->Paint(canvas->sk_canvas(), part, state, rect, extra);
}
}
@@ -252,16 +252,16 @@
alignment_(ALIGN_LEFT),
font_(ResourceBundle::GetSharedInstance().GetFont(
ResourceBundle::BaseFont)),
- color_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_enabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_disabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonDisabledColor)),
- color_highlight_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHighlightColor)),
- color_hover_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHoverColor)),
+ color_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonEnabledColor)),
+ color_enabled_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonEnabledColor)),
+ color_disabled_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonDisabledColor)),
+ color_highlight_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonHighlightColor)),
+ color_hover_(gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonHoverColor)),
text_halo_color_(0),
has_text_halo_(false),
active_text_shadow_color_(0),
@@ -458,15 +458,15 @@
}
void TextButtonBase::GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const {
+ gfx::NativeTheme::ExtraParams* params) const {
params->button.checked = false;
params->button.indeterminate = false;
params->button.is_default = false;
params->button.has_border = false;
params->button.classic_state = 0;
params->button.background_color =
- ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonBackgroundColor);
+ gfx::NativeTheme::instance()->GetSystemColor(
+ gfx::NativeTheme::kColorId_TextButtonBackgroundColor);
}
gfx::Rect TextButtonBase::GetContentBounds(int extra_width) const {
@@ -608,21 +608,21 @@
return GetLocalBounds();
}
-ui::NativeTheme::State TextButtonBase::GetThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
switch(state()) {
case BS_DISABLED:
- return ui::NativeTheme::kDisabled;
+ return gfx::NativeTheme::kDisabled;
case BS_NORMAL:
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
case BS_HOT:
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
case BS_PUSHED:
- return ui::NativeTheme::kPressed;
+ return gfx::NativeTheme::kPressed;
default:
NOTREACHED() << "Unknown state: " << state();
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
}
@@ -630,23 +630,23 @@
#if defined(USE_AURA)
return hover_animation_.get();
#elif defined(OS_WIN)
- return ui::NativeThemeWin::instance()->IsThemingActive()
+ return gfx::NativeThemeWin::instance()->IsThemingActive()
? hover_animation_.get() : NULL;
#else
return hover_animation_.get();
#endif
}
-ui::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetBackgroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kNormal;
+ return gfx::NativeTheme::kNormal;
}
-ui::NativeTheme::State TextButtonBase::GetForegroundThemeState(
- ui::NativeTheme::ExtraParams* params) const {
+gfx::NativeTheme::State TextButtonBase::GetForegroundThemeState(
+ gfx::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
- return ui::NativeTheme::kHovered;
+ return gfx::NativeTheme::kHovered;
}
////////////////////////////////////////////////////////////////////////////////
@@ -756,11 +756,11 @@
}
}
-ui::NativeTheme::Part TextButton::GetThemePart() const {
- return ui::NativeTheme::kPushButton;
+gfx::NativeTheme::Part TextButton::GetThemePart() const {
+ return gfx::NativeTheme::kPushButton;
}
-void TextButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
+void TextButton::GetExtraParams(gfx::NativeTheme::ExtraParams* params) const {
TextButtonBase::GetExtraParams(params);
params->button.is_default = is_default_;
}
@@ -848,7 +848,7 @@
}
void NativeTextButton::GetExtraParams(
- ui::NativeTheme::ExtraParams* params) const {
+ gfx::NativeTheme::ExtraParams* params) const {
TextButton::GetExtraParams(params);
params->button.has_border = true;
}
« no previous file with comments | « ui/views/controls/button/text_button.h ('k') | ui/views/controls/combobox/native_combobox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698