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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 8597015: Add a new GetSystemColor method to native theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 9 years, 1 month 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
« ui/gfx/native_theme_win.cc ('K') | « ui/gfx/native_theme_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 610ae8d942e23c49d7011a81dd2edfe518141f5e..33676c6e3309e66f81ec162a4d54a715b29cbb64 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -10,8 +10,6 @@
#include <windows.h>
#include <uxtheme.h>
#include <vsstyle.h>
-#elif defined(TOOLKIT_USES_GTK)
-#include <gtk/gtk.h>
#endif
#include <algorithm>
@@ -50,14 +48,6 @@ void UpdateButtonHelper(NativeTextButton* button_view,
button_view->SetVisible(delegate->IsDialogButtonVisible(button));
}
-#if defined(OS_WIN)
-void FillViewWithSysColor(gfx::Canvas* canvas, View* view, COLORREF color) {
- SkColor sk_color =
- SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color));
- canvas->FillRect(sk_color, view->GetLocalBounds());
-}
-#endif
-
// DialogButton ----------------------------------------------------------------
// DialogButtons is used for the ok/cancel buttons of the window. DialogButton
@@ -314,19 +304,9 @@ const DialogClientView* DialogClientView::AsDialogClientView() const {
// DialogClientView, View overrides:
void DialogClientView::OnPaint(gfx::Canvas* canvas) {
-#if defined(OS_WIN)
- FillViewWithSysColor(canvas, this, GetSysColor(COLOR_3DFACE));
-#elif defined(USE_WAYLAND) || defined(USE_AURA)
- SkColor sk_color = SkColorSetARGB(200, 255, 255, 255);
- canvas->FillRect(sk_color, GetLocalBounds());
-#else
- GtkWidget* widget = GetWidget()->GetNativeView();
- if (GTK_IS_WINDOW(widget)) {
- GtkStyle* window_style = gtk_widget_get_style(widget);
- canvas->FillRect(gfx::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]),
- GetLocalBounds());
- }
-#endif
+ SkColor bg_color = gfx::NativeTheme::instance()->
+ GetSystemColor(gfx::NativeTheme::kDialogBackgroundColorId);
Ben Goodger (Google) 2011/11/21 18:59:59 reformat as: gfx::NativeTheme::instance()->GetSys
benrg 2011/11/21 19:54:20 Done.
+ canvas->FillRect(bg_color, GetLocalBounds());
}
void DialogClientView::PaintChildren(gfx::Canvas* canvas) {
« ui/gfx/native_theme_win.cc ('K') | « ui/gfx/native_theme_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698