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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/shell_dialogs/print_settings_dialog_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/shell_dialogs/print_settings_dialog_win.cc
diff --git a/ui/shell_dialogs/print_settings_dialog_win.cc b/ui/shell_dialogs/print_settings_dialog_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f3f89b3ed71c87dd2ca7ed154c4368473e3a0181
--- /dev/null
+++ b/ui/shell_dialogs/print_settings_dialog_win.cc
@@ -0,0 +1,58 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/shell_dialogs/print_settings_dialog_win.h"
+
+#include "base/bind.h"
+#include "base/threading/thread.h"
+
+#if defined(USE_AURA)
+#include "ui/aura/root_window.h"
+#endif
+
+namespace ui {
+
+PrintSettingsDialogWin::PrintSettingsDialogWin(
+ PrintSettingsDialogWin::Observer* observer)
+ : observer_(observer) {
+}
+
+PrintSettingsDialogWin::~PrintSettingsDialogWin() {
+}
+
+void PrintSettingsDialogWin::GetPrintSettings(PrintDialogFunc print_dialog_func,
+ HWND owning_window,
+ PRINTDLGEX* dialog_options) {
+ DCHECK(observer_);
+
+ ExecutePrintSettingsParams execute_params(BeginRun(owning_window),
+ owning_window,
+ print_dialog_func,
+ dialog_options);
+ execute_params.run_state.dialog_thread->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &PrintSettingsDialogWin::ExecutePrintSettings, this, execute_params));
+}
+
+void PrintSettingsDialogWin::ExecutePrintSettings(
+ const ExecutePrintSettingsParams& params) {
+ HRESULT hr = (*params.print_dialog_func)(params.dialog_options);
+ params.ui_proxy->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &PrintSettingsDialogWin::PrintSettingsCompleted, this, hr, params));
+}
+
+void PrintSettingsDialogWin::PrintSettingsCompleted(
+ HRESULT hresult,
+ const ExecutePrintSettingsParams& params) {
+ EndRun(params.run_state);
+ if (hresult != S_OK)
+ observer_->PrintSettingsCancelled(params.dialog_options);
+ else
+ observer_->PrintSettingsConfirmed(params.dialog_options);
+}
+
+} // namespace ui
« 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