OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "views/window/dialog_client_view.h" | 5 #include "views/window/dialog_client_view.h" |
6 | 6 |
| 7 #if defined(OS_WIN) |
| 8 #include <windows.h> |
| 9 #include <uxtheme.h> |
| 10 #include <vsstyle.h> |
| 11 #else |
| 12 #include <gtk/gtk.h> |
| 13 #endif |
| 14 |
| 15 #include <algorithm> |
| 16 |
7 #include "app/gfx/canvas.h" | 17 #include "app/gfx/canvas.h" |
8 #include "app/gfx/font.h" | 18 #include "app/gfx/font.h" |
9 #include "app/l10n_util.h" | 19 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 20 #include "app/resource_bundle.h" |
11 #include "base/keyboard_codes.h" | 21 #include "base/keyboard_codes.h" |
12 #include "grit/app_strings.h" | 22 #include "grit/app_strings.h" |
| 23 #include "skia/ext/skia_utils_gtk.h" |
13 #include "views/controls/button/native_button.h" | 24 #include "views/controls/button/native_button.h" |
14 #include "views/standard_layout.h" | 25 #include "views/standard_layout.h" |
15 #include "views/window/dialog_delegate.h" | 26 #include "views/window/dialog_delegate.h" |
16 #include "views/window/window.h" | 27 #include "views/window/window.h" |
17 | |
18 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
19 #include <windows.h> | |
20 #include <uxtheme.h> | |
21 #include <vsstyle.h> | |
22 | |
23 #include "base/gfx/native_theme.h" | 29 #include "base/gfx/native_theme.h" |
24 #else | 30 #else |
25 #include <gtk/gtk.h> | |
26 | |
27 #include "views/window/hit_test.h" | 31 #include "views/window/hit_test.h" |
28 #include "views/widget/widget.h" | 32 #include "views/widget/widget.h" |
29 #endif | 33 #endif |
30 | 34 |
31 namespace views { | 35 namespace views { |
32 | 36 |
33 namespace { | 37 namespace { |
34 | 38 |
35 // Updates any of the standard buttons according to the delegate. | 39 // Updates any of the standard buttons according to the delegate. |
36 void UpdateButtonHelper(NativeButton* button_view, | 40 void UpdateButtonHelper(NativeButton* button_view, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 //////////////////////////////////////////////////////////////////////////////// | 271 //////////////////////////////////////////////////////////////////////////////// |
268 // DialogClientView, View overrides: | 272 // DialogClientView, View overrides: |
269 | 273 |
270 void DialogClientView::Paint(gfx::Canvas* canvas) { | 274 void DialogClientView::Paint(gfx::Canvas* canvas) { |
271 #if defined(OS_WIN) | 275 #if defined(OS_WIN) |
272 FillViewWithSysColor(canvas, this, GetSysColor(COLOR_3DFACE)); | 276 FillViewWithSysColor(canvas, this, GetSysColor(COLOR_3DFACE)); |
273 #else | 277 #else |
274 GtkWidget* widget = GetWidget()->GetNativeView(); | 278 GtkWidget* widget = GetWidget()->GetNativeView(); |
275 if (GTK_IS_WINDOW(widget)) { | 279 if (GTK_IS_WINDOW(widget)) { |
276 GtkStyle* window_style = gtk_widget_get_style(widget); | 280 GtkStyle* window_style = gtk_widget_get_style(widget); |
277 canvas->FillRectInt(SkColorSetRGB(window_style->bg[GTK_STATE_NORMAL].red, | 281 canvas->FillRectInt(skia::GdkColorToSkColor( |
278 window_style->bg[GTK_STATE_NORMAL].green, | 282 window_style->bg[GTK_STATE_NORMAL]), |
279 window_style->bg[GTK_STATE_NORMAL].blue), | |
280 0, 0, width(), height()); | 283 0, 0, width(), height()); |
281 } | 284 } |
282 #endif | 285 #endif |
283 } | 286 } |
284 | 287 |
285 void DialogClientView::PaintChildren(gfx::Canvas* canvas) { | 288 void DialogClientView::PaintChildren(gfx::Canvas* canvas) { |
286 View::PaintChildren(canvas); | 289 View::PaintChildren(canvas); |
287 if (!window()->IsMaximized() && !window()->IsMinimized()) | 290 if (!window()->IsMaximized() && !window()->IsMinimized()) |
288 PaintSizeBox(canvas); | 291 PaintSizeBox(canvas); |
289 } | 292 } |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 initialized = true; | 505 initialized = true; |
503 } | 506 } |
504 } | 507 } |
505 | 508 |
506 void DialogClientView::Close() { | 509 void DialogClientView::Close() { |
507 window()->Close(); | 510 window()->Close(); |
508 GetDialogDelegate()->OnClose(); | 511 GetDialogDelegate()->OnClose(); |
509 } | 512 } |
510 | 513 |
511 } // namespace views | 514 } // namespace views |
OLD | NEW |