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

Side by Side Diff: printing/printing_context_android.cc

Issue 63483007: Refactor Android printing code to make it more testable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add license to PrintingControllerFactory Created 7 years, 1 month 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
« no previous file with comments | « printing/android/java/src/org/chromium/printing/PrintingControllerImpl.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "printing/printing_context_android.h" 5 #include "printing/printing_context_android.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 int max_pages, 84 int max_pages,
85 bool has_selection, 85 bool has_selection,
86 const PrintSettingsCallback& callback) { 86 const PrintSettingsCallback& callback) {
87 // This method is always run in the UI thread. 87 // This method is always run in the UI thread.
88 callback_ = callback; 88 callback_ = callback;
89 89
90 JNIEnv* env = base::android::AttachCurrentThread(); 90 JNIEnv* env = base::android::AttachCurrentThread();
91 if (j_printing_context_.is_null()) { 91 if (j_printing_context_.is_null()) {
92 j_printing_context_.Reset(Java_PrintingContext_create( 92 j_printing_context_.Reset(Java_PrintingContext_create(
93 env, 93 env,
94 base::android::GetApplicationContext(),
95 reinterpret_cast<int>(this))); 94 reinterpret_cast<int>(this)));
96 } 95 }
97 96
98 Java_PrintingContext_pageCountEstimationDone(env, 97 Java_PrintingContext_pageCountEstimationDone(env,
99 j_printing_context_.obj(), 98 j_printing_context_.obj(),
100 max_pages); 99 max_pages);
101 } 100 }
102 101
103 void PrintingContextAndroid::AskUserForSettingsReply(JNIEnv* env, 102 void PrintingContextAndroid::AskUserForSettingsReply(JNIEnv* env,
104 jobject obj, 103 jobject obj,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Intentional No-op. 237 // Intentional No-op.
239 return NULL; 238 return NULL;
240 } 239 }
241 240
242 // static 241 // static
243 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { 242 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) {
244 return RegisterNativesImpl(env); 243 return RegisterNativesImpl(env);
245 } 244 }
246 245
247 } // namespace printing 246 } // namespace printing
OLDNEW
« no previous file with comments | « printing/android/java/src/org/chromium/printing/PrintingControllerImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698