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 "chrome/browser/shell_dialogs.h" | 5 #include "chrome/browser/shell_dialogs.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #include <atlbase.h> | 10 #include <atlbase.h> |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 &SelectFontDialogImpl::FontNotSelected, params, run_state)); | 705 &SelectFontDialogImpl::FontNotSelected, params, run_state)); |
706 } | 706 } |
707 } | 707 } |
708 | 708 |
709 void SelectFontDialogImpl::FontSelected(LOGFONT logfont, | 709 void SelectFontDialogImpl::FontSelected(LOGFONT logfont, |
710 void* params, | 710 void* params, |
711 RunState run_state) { | 711 RunState run_state) { |
712 if (listener_) { | 712 if (listener_) { |
713 HFONT font = CreateFontIndirect(&logfont); | 713 HFONT font = CreateFontIndirect(&logfont); |
714 if (font) { | 714 if (font) { |
715 listener_->FontSelected(ChromeFont::CreateFont(font), params); | 715 listener_->FontSelected(gfx::Font::CreateFont(font), params); |
716 DeleteObject(font); | 716 DeleteObject(font); |
717 } else { | 717 } else { |
718 listener_->FontSelectionCanceled(params); | 718 listener_->FontSelectionCanceled(params); |
719 } | 719 } |
720 } | 720 } |
721 EndRun(run_state); | 721 EndRun(run_state); |
722 } | 722 } |
723 | 723 |
724 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 724 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
725 if (listener_) | 725 if (listener_) |
726 listener_->FontSelectionCanceled(params); | 726 listener_->FontSelectionCanceled(params); |
727 EndRun(run_state); | 727 EndRun(run_state); |
728 } | 728 } |
729 | 729 |
730 // static | 730 // static |
731 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 731 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
732 return new SelectFontDialogImpl(listener); | 732 return new SelectFontDialogImpl(listener); |
733 } | 733 } |
OLD | NEW |