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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_border.cc

Issue 243703009: Linux Aura: Use appropriate button style depending on aura/gtk NativeTheme (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updat Created 6 years, 8 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 | « chrome/browser/ui/libgtk2ui/gtk2_border.h ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/gtk2_border.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_border.cc b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
index eefa5a49c7c227fedb6d6d56e240f56724b7f253..c98888addbda716270c10a392f30d73347e92126 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_border.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
@@ -71,11 +71,9 @@ class ButtonImageSkiaSource : public gfx::ImageSkiaSource {
} // namespace
Gtk2Border::Gtk2Border(Gtk2UI* gtk2_ui,
- views::LabelButton* owning_button,
- scoped_ptr<views::Border> border)
+ views::LabelButton* owning_button)
: gtk2_ui_(gtk2_ui),
- owning_button_(owning_button),
- border_(border.Pass()) {
+ owning_button_(owning_button) {
gtk2_ui_->AddNativeThemeChangeObserver(this);
}
@@ -84,12 +82,6 @@ Gtk2Border::~Gtk2Border() {
}
void Gtk2Border::Paint(const views::View& view, gfx::Canvas* canvas) {
- ui::ThemeProvider* provider = owning_button_->GetThemeProvider();
- if (!provider || !provider->UsingNativeTheme()) {
- border_->Paint(view, canvas);
- return;
- }
-
DCHECK_EQ(&view, owning_button_);
const NativeThemeDelegate* native_theme_delegate = owning_button_;
gfx::Rect rect(native_theme_delegate->GetThemePaintRect());
@@ -120,26 +112,12 @@ void Gtk2Border::Paint(const views::View& view, gfx::Canvas* canvas) {
}
gfx::Insets Gtk2Border::GetInsets() const {
- // TODO(erg): We want to differentiate between buttons on the toolbar and
- // buttons everywhere else. Right now, the only way to do this is to check
- // the style. STYLE_BUTTON is the button style used in dialogs, and
- // STYLE_TEXTUBTTON is the button style used in the toolbar, including all
- // the buttons which are just toolbar images.
- ui::ThemeProvider* provider = owning_button_->GetThemeProvider();
- if (owning_button_->style() == views::Button::STYLE_BUTTON ||
- (!provider || !provider->UsingNativeTheme()))
- return border_->GetInsets();
-
// On STYLE_TEXTUBTTON, we want the smaller insets so we can fit the GTK icon
// in the toolbar without cutting off the edges of the GTK image.
return gtk2_ui_->GetButtonInsets();
}
gfx::Size Gtk2Border::GetMinimumSize() const {
- ui::ThemeProvider* provider = owning_button_->GetThemeProvider();
- if (!provider || !provider->UsingNativeTheme())
- return border_->GetMinimumSize();
-
gfx::Insets insets = GetInsets();
return gfx::Size(insets.width(), insets.height());
}
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_border.h ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698