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

Side by Side Diff: printing/printing_context_android.h

Issue 23116003: Adds PrintingContext implementation stub for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses code review issues. Solves infinite recursion bug. Improves the interface between Java an… Created 7 years, 4 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 unified diff | Download patch
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 #ifndef PRINTING_PRINTING_CONTEXT_ANDROID_H_
6 #define PRINTING_PRINTING_CONTEXT_ANDROID_H_
7
8 #include <jni.h>
9
10 #include <string>
11
12 #include "base/android/scoped_java_ref.h"
13 #include "printing/printing_context.h"
14
15 namespace printing {
16
17 class PRINTING_EXPORT PrintingContextAndroid : public PrintingContext {
whywhat 2013/08/16 23:31:36 nit: class-level comment?
cimamoglu1 2013/08/19 13:47:26 Done.
18 public:
19 explicit PrintingContextAndroid(const std::string& app_locale);
20 virtual ~PrintingContextAndroid();
21
22 // Called when writing a page to a PDF operation for a particular file
whywhat 2013/08/16 23:31:36 nit: Called when the page is successfully written
cimamoglu1 2013/08/19 13:47:26 Done.
23 // descriptor is done, either successfully or not.
24 static void PdfWritingDone(int fd, bool success);
25
26 // Called from Java, when printing settings from the user is ready or the
whywhat 2013/08/16 23:31:36 nit: s/is/are/
cimamoglu1 2013/08/19 13:47:26 Done.
27 // printing operation is canceled.
28 void AskUserForSettingsReply(bool success);
29
30 // PrintingContext implementation.
31 virtual void AskUserForSettings(
32 gfx::NativeView parent_view,
33 int max_pages,
34 bool has_selection,
35 const PrintSettingsCallback& callback) OVERRIDE;
36 virtual Result UseDefaultSettings() OVERRIDE;
37 virtual Result UpdatePrinterSettings(
38 const base::DictionaryValue& job_settings,
39 const PageRanges& ranges) OVERRIDE;
40 virtual Result InitWithSettings(const PrintSettings& settings) OVERRIDE;
41 virtual Result NewDocument(const string16& document_name) OVERRIDE;
42 virtual Result NewPage() OVERRIDE;
43 virtual Result PageDone() OVERRIDE;
44 virtual Result DocumentDone() OVERRIDE;
45 virtual void Cancel() OVERRIDE;
46 virtual void ReleaseContext() OVERRIDE;
47 virtual gfx::NativeDrawingContext context() const OVERRIDE;
48
49 static bool RegisterPrintingContext(JNIEnv* env);
50
51 private:
52 base::android::ScopedJavaGlobalRef<jobject> j_printing_context_;
53
54 // The callback from AskUserForSettings to be called upon the reply from Java.
whywhat 2013/08/16 23:31:36 nit: s/upon the reply from Java/when the settings
cimamoglu1 2013/08/19 13:47:26 Done.
55 PrintSettingsCallback callback_;
56
57 DISALLOW_COPY_AND_ASSIGN(PrintingContextAndroid);
58 };
59
60 } // namespace printing
61
62 #endif // PRINTING_PRINTING_CONTEXT_ANDROID_H_
63
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698