Chromium Code Reviews| Index: printing/printing_context.h |
| diff --git a/printing/printing_context.h b/printing/printing_context.h |
| index 823a5af446678fe32d30c0eae831807e89b8997c..3204dd8134dd294bdcc1a50c6e8844a18b7d348c 100644 |
| --- a/printing/printing_context.h |
| +++ b/printing/printing_context.h |
| @@ -25,6 +25,19 @@ namespace printing { |
| // printer and manage the document and page breaks. |
| class PRINTING_EXPORT PrintingContext { |
| public: |
| + // Printing context delegate. |
| + class Delegate { |
| + public: |
| + Delegate() {}; |
| + virtual ~Delegate() {}; |
| + |
| + // Return parent view to use for modal dialogs. |
| + virtual gfx::NativeView GetParentView() = 0; |
| + |
| + // Return parent view to use for modal dialogs. |
|
yzshen1
2014/08/21 17:55:20
Wrong comment?
Vitaly Buka (NO REVIEWS)
2014/08/21 18:00:56
Done.
|
| + virtual std::string GetAppLocale() = 0; |
| + }; |
| + |
| // Tri-state result for user behavior-dependent functions. |
| enum Result { |
| OK, |
| @@ -42,8 +55,7 @@ class PRINTING_EXPORT PrintingContext { |
| // context with the select device settings. The result of the call is returned |
| // in the callback. This is necessary for Linux, which only has an |
| // asynchronous printing API. |
| - virtual void AskUserForSettings(gfx::NativeView parent_view, |
| - int max_pages, |
| + virtual void AskUserForSettings(int max_pages, |
| bool has_selection, |
| const PrintSettingsCallback& callback) = 0; |
| @@ -98,9 +110,8 @@ class PRINTING_EXPORT PrintingContext { |
| virtual gfx::NativeDrawingContext context() const = 0; |
| // Creates an instance of this object. Implementers of this interface should |
| - // implement this method to create an object of their implementation. The |
| - // caller owns the returned object. |
| - static PrintingContext* Create(const std::string& app_locale); |
| + // implement this method to create an object of their implementation. |
| + static scoped_ptr<PrintingContext> Create(Delegate* delegate); |
| void set_margin_type(MarginType type); |
| @@ -109,7 +120,7 @@ class PRINTING_EXPORT PrintingContext { |
| } |
| protected: |
| - explicit PrintingContext(const std::string& app_locale); |
| + explicit PrintingContext(Delegate* delegate); |
| // Reinitializes the settings for object reuse. |
| void ResetSettings(); |
| @@ -120,6 +131,9 @@ class PRINTING_EXPORT PrintingContext { |
| // Complete print context settings. |
| PrintSettings settings_; |
| + // Printing context delegate. |
| + Delegate* delegate_; |
| + |
| // The dialog box has been dismissed. |
| volatile bool dialog_box_dismissed_; |
| @@ -129,9 +143,6 @@ class PRINTING_EXPORT PrintingContext { |
| // Did the user cancel the print job. |
| volatile bool abort_printing_; |
| - // The application locale. |
| - std::string app_locale_; |
| - |
| private: |
| DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
| }; |