| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 10 |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 run_state)); | 1100 run_state)); |
| 1101 } | 1101 } |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 void SelectFontDialogImpl::FontSelected(LOGFONT logfont, | 1104 void SelectFontDialogImpl::FontSelected(LOGFONT logfont, |
| 1105 void* params, | 1105 void* params, |
| 1106 RunState run_state) { | 1106 RunState run_state) { |
| 1107 if (listener_) { | 1107 if (listener_) { |
| 1108 HFONT font = CreateFontIndirect(&logfont); | 1108 HFONT font = CreateFontIndirect(&logfont); |
| 1109 if (font) { | 1109 if (font) { |
| 1110 listener_->FontSelected(gfx::Font::CreateFont(font), params); | 1110 listener_->FontSelected(gfx::Font(font), params); |
| 1111 DeleteObject(font); | 1111 DeleteObject(font); |
| 1112 } else { | 1112 } else { |
| 1113 listener_->FontSelectionCanceled(params); | 1113 listener_->FontSelectionCanceled(params); |
| 1114 } | 1114 } |
| 1115 } | 1115 } |
| 1116 EndRun(run_state); | 1116 EndRun(run_state); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { | 1119 void SelectFontDialogImpl::FontNotSelected(void* params, RunState run_state) { |
| 1120 if (listener_) | 1120 if (listener_) |
| 1121 listener_->FontSelectionCanceled(params); | 1121 listener_->FontSelectionCanceled(params); |
| 1122 EndRun(run_state); | 1122 EndRun(run_state); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 // static | 1125 // static |
| 1126 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { | 1126 SelectFontDialog* SelectFontDialog::Create(Listener* listener) { |
| 1127 return new SelectFontDialogImpl(listener); | 1127 return new SelectFontDialogImpl(listener); |
| 1128 } | 1128 } |
| OLD | NEW |