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 "views/window/dialog_client_view.h" | 5 #include "views/window/dialog_client_view.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <uxtheme.h> | 9 #include <uxtheme.h> |
10 #include <vsstyle.h> | 10 #include <vsstyle.h> |
(...skipping 29 matching lines...) Expand all Loading... |
40 namespace views { | 40 namespace views { |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 // Updates any of the standard buttons according to the delegate. | 44 // Updates any of the standard buttons according to the delegate. |
45 void UpdateButtonHelper(NativeTextButton* button_view, | 45 void UpdateButtonHelper(NativeTextButton* button_view, |
46 DialogDelegate* delegate, | 46 DialogDelegate* delegate, |
47 MessageBoxFlags::DialogButton button) { | 47 MessageBoxFlags::DialogButton button) { |
48 std::wstring label = delegate->GetDialogButtonLabel(button); | 48 std::wstring label = delegate->GetDialogButtonLabel(button); |
49 if (!label.empty()) | 49 if (!label.empty()) |
50 button_view->SetLabel(label); | 50 button_view->SetText(label); |
51 button_view->SetEnabled(delegate->IsDialogButtonEnabled(button)); | 51 button_view->SetEnabled(delegate->IsDialogButtonEnabled(button)); |
52 button_view->SetVisible(delegate->IsDialogButtonVisible(button)); | 52 button_view->SetVisible(delegate->IsDialogButtonVisible(button)); |
53 } | 53 } |
54 | 54 |
55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
56 void FillViewWithSysColor(gfx::Canvas* canvas, View* view, COLORREF color) { | 56 void FillViewWithSysColor(gfx::Canvas* canvas, View* view, COLORREF color) { |
57 SkColor sk_color = | 57 SkColor sk_color = |
58 SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color)); | 58 SkColorSetRGB(GetRValue(color), GetGValue(color), GetBValue(color)); |
59 canvas->FillRectInt(sk_color, 0, 0, view->width(), view->height()); | 59 canvas->FillRectInt(sk_color, 0, 0, view->width(), view->height()); |
60 } | 60 } |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 void DialogClientView::InitClass() { | 577 void DialogClientView::InitClass() { |
578 static bool initialized = false; | 578 static bool initialized = false; |
579 if (!initialized) { | 579 if (!initialized) { |
580 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 580 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
581 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); | 581 dialog_button_font_ = new gfx::Font(rb.GetFont(ResourceBundle::BaseFont)); |
582 initialized = true; | 582 initialized = true; |
583 } | 583 } |
584 } | 584 } |
585 | 585 |
586 } // namespace views | 586 } // namespace views |
OLD | NEW |