diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 04:58:20 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-11 04:58:20 +0000 |
commit | eaa389e3a4be9d9f87113043156cf6ac85f67c8d (patch) | |
tree | 5bf89af4a8b7a477dd2e878e08e98b9852333b47 /printing/print_dialog_gtk_interface.h | |
parent | 9b6db26fcc22a7a4ec0510a93733b2e190d9e649 (diff) | |
download | chromium_src-eaa389e3a4be9d9f87113043156cf6ac85f67c8d.zip chromium_src-eaa389e3a4be9d9f87113043156cf6ac85f67c8d.tar.gz chromium_src-eaa389e3a4be9d9f87113043156cf6ac85f67c8d.tar.bz2 |
Linux: Refactor PrintDialogGtk in preparation for adding dialog-less printing.
BUG=none
TEST=Printing on Linux still works.
Review URL: http://codereview.chromium.org/6811016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/print_dialog_gtk_interface.h')
-rw-r--r-- | printing/print_dialog_gtk_interface.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/printing/print_dialog_gtk_interface.h b/printing/print_dialog_gtk_interface.h new file mode 100644 index 0000000..04198da --- /dev/null +++ b/printing/print_dialog_gtk_interface.h @@ -0,0 +1,39 @@ +// Copyright (c) 2011 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. + +#ifndef PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ +#define PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ + +#include "base/string16.h" +#include "printing/printing_context_cairo.h" + +namespace printing { + +// An interface for GTK printing dialogs. Classes that live outside of +// printing/ can implement this interface and get threading requirements +// correct without exposing those requirements to printing/. +class PrintDialogGtkInterface { + public: + // Shows the dialog and handles the response with |callback|. + virtual void ShowDialog( + PrintingContextCairo::PrintSettingsCallback* callback) = 0; + + // Prints the document named |document_name| contained in |metafile|. + // Called from the print worker thread. Once called, the + // PrintDialogGtkInterface instance should not be reused. + virtual void PrintDocument(const NativeMetafile* metafile, + const string16& document_name) = 0; + + // Same as AddRef/Release, but with different names since + // PrintDialogGtkInterface does not inherit from RefCounted. + virtual void AddRefToDialog() = 0; + virtual void ReleaseDialog() = 0; + + protected: + virtual ~PrintDialogGtkInterface() {} +}; + +} // namespace printing + +#endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ |