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

Unified Diff: printing/printing_context_win.cc

Issue 10701155: Send request to show print system dialog to Metro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_win.cc
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index ebe9d183889761e5c1f55e3cb2196d70f49cfb84..99f92cb3be0005305e7b4ea6865b8db8932a16a8 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -14,6 +14,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "base/win/metro.h"
#include "printing/backend/win_helper.h"
#include "printing/print_job_constants.h"
#include "printing/print_settings_initializer_win.h"
@@ -219,6 +220,21 @@ void PrintingContextWin::AskUserForSettings(
const PrintSettingsCallback& callback) {
#if !defined(USE_AURA)
DCHECK(!in_print_job_);
+
+ if (base::win::IsMetroProcess()) {
+ // The system dialog can not be opened while running in Metro.
+ // But we can programatically launch the Metro print device charm though.
+ HMODULE metro_module = base::win::GetMetroModule();
+ if (metro_module != NULL) {
+ typedef void (*MetroShowPrintUI)();
Albert Bodenhamer 2012/07/12 16:32:10 Nit: Is the prototype for MetroShowPrintUI defined
MAD 2012/07/12 17:16:14 There's work in progress for this... Not quite rea
+ MetroShowPrintUI metro_show_print_ui =
+ reinterpret_cast<MetroShowPrintUI>(
+ ::GetProcAddress(metro_module, "MetroShowPrintUI"));
+ if (metro_show_print_ui)
+ metro_show_print_ui();
+ }
+ return callback.Run(CANCEL);
+ }
dialog_box_dismissed_ = false;
HWND window;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698