OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/views/window/dialog_client_view.h" | 5 #include "ui/views/window/dialog_client_view.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 void DialogClientView::OnPaint(gfx::Canvas* canvas) { | 308 void DialogClientView::OnPaint(gfx::Canvas* canvas) { |
309 #if defined(TOOLKIT_USES_GTK) | 309 #if defined(TOOLKIT_USES_GTK) |
310 // TODO(benrg): Unfortunately, GetSystemColor often returns the wrong color | 310 // TODO(benrg): Unfortunately, GetSystemColor often returns the wrong color |
311 // under GTK right now. This is meant to be a temporary fix. See related TODO | 311 // under GTK right now. This is meant to be a temporary fix. See related TODO |
312 // in ui/gfx/native_theme_gtk.cc. | 312 // in ui/gfx/native_theme_gtk.cc. |
313 GtkWidget* widget = GetWidget()->GetNativeView(); | 313 GtkWidget* widget = GetWidget()->GetNativeView(); |
314 if (!GTK_IS_WINDOW(widget)) | 314 if (!GTK_IS_WINDOW(widget)) |
315 return; | 315 return; |
316 SkColor bg_color = gfx::GdkColorToSkColor( | 316 SkColor bg_color = gfx::GdkColorToSkColor( |
317 gtk_widget_get_style(widget)->bg[GTK_STATE_NORMAL]); | 317 gtk_widget_get_style(widget)->bg[GTK_STATE_NORMAL]); |
318 #else | 318 #else |
319 SkColor bg_color = gfx::NativeTheme::instance()->GetSystemColor( | 319 SkColor bg_color = gfx::NativeTheme::instance()->GetSystemColor( |
320 gfx::NativeTheme::kColorId_DialogBackground); | 320 gfx::NativeTheme::kColorId_DialogBackground); |
321 #endif | 321 #endif |
322 canvas->FillRect(bg_color, GetLocalBounds()); | 322 canvas->FillRect(GetLocalBounds(), bg_color); |
323 } | 323 } |
324 | 324 |
325 void DialogClientView::PaintChildren(gfx::Canvas* canvas) { | 325 void DialogClientView::PaintChildren(gfx::Canvas* canvas) { |
326 View::PaintChildren(canvas); | 326 View::PaintChildren(canvas); |
327 if (!GetWidget()->IsMaximized() && !GetWidget()->IsMinimized()) | 327 if (!GetWidget()->IsMaximized() && !GetWidget()->IsMinimized()) |
328 PaintSizeBox(canvas); | 328 PaintSizeBox(canvas); |
329 } | 329 } |
330 | 330 |
331 void DialogClientView::Layout() { | 331 void DialogClientView::Layout() { |
332 if (has_dialog_buttons()) | 332 if (has_dialog_buttons()) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 void DialogClientView::InitClass() { | 575 void DialogClientView::InitClass() { |
576 static bool initialized = false; | 576 static bool initialized = false; |
577 if (!initialized) { | 577 if (!initialized) { |
578 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 578 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
579 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); | 579 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); |
580 initialized = true; | 580 initialized = true; |
581 } | 581 } |
582 } | 582 } |
583 | 583 |
584 } // namespace views | 584 } // namespace views |
OLD | NEW |