Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Side by Side Diff: ui/shell_dialogs/print_settings_dialog_win.cc

Issue 27441003: Use BaseShellDialog for print dialog on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/shell_dialogs/print_settings_dialog_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/shell_dialogs/print_settings_dialog_win.h"
6
7 #include "base/bind.h"
8 #include "base/threading/thread.h"
9
10 #if defined(USE_AURA)
11 #include "ui/aura/root_window.h"
12 #endif
13
14 namespace ui {
15
16 PrintSettingsDialogWin::PrintSettingsDialogWin(
17 PrintSettingsDialogWin::Observer* observer)
18 : observer_(observer) {
19 }
20
21 PrintSettingsDialogWin::~PrintSettingsDialogWin() {
22 }
23
24 void PrintSettingsDialogWin::GetPrintSettings(PrintDialogFunc print_dialog_func,
25 HWND owning_window,
26 PRINTDLGEX* dialog_options) {
27 DCHECK(observer_);
28
29 ExecutePrintSettingsParams execute_params(BeginRun(owning_window),
30 owning_window,
31 print_dialog_func,
32 dialog_options);
33 execute_params.run_state.dialog_thread->message_loop()->PostTask(
34 FROM_HERE,
35 base::Bind(
36 &PrintSettingsDialogWin::ExecutePrintSettings, this, execute_params));
37 }
38
39 void PrintSettingsDialogWin::ExecutePrintSettings(
40 const ExecutePrintSettingsParams& params) {
41 HRESULT hr = (*params.print_dialog_func)(params.dialog_options);
42 params.ui_proxy->PostTask(
43 FROM_HERE,
44 base::Bind(
45 &PrintSettingsDialogWin::PrintSettingsCompleted, this, hr, params));
46 }
47
48 void PrintSettingsDialogWin::PrintSettingsCompleted(
49 HRESULT hresult,
50 const ExecutePrintSettingsParams& params) {
51 EndRun(params.run_state);
52 if (hresult != S_OK)
53 observer_->PrintSettingsCancelled(params.dialog_options);
54 else
55 observer_->PrintSettingsConfirmed(params.dialog_options);
56 }
57
58 } // namespace ui
OLDNEW
« no previous file with comments | « ui/shell_dialogs/print_settings_dialog_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698