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

Unified Diff: chrome/browser/android/tab_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: Moved isPrintingController into PrintingControllerImpl, cleaned tiny bits 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 3c0c45072a573d8465d97a878f00facd646279ed..69d6bb3cfa371fa81a9aa152644c948a2f6053a5 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h"
#include "chrome/browser/prerender/prerender_tab_helper.h"
+#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/sessions/session_tab_helper.h"
@@ -399,6 +400,21 @@ void TabAndroid::SetActiveNavigationEntryTitleForUrl(JNIEnv* env,
entry->SetTitle(title);
}
+
bulach 2013/11/19 15:32:22 nit: remove extra \n
cimamoglu1 2013/11/19 17:40:33 Done.
+bool TabAndroid::Print(JNIEnv* env, jobject obj) {
+ if (!web_contents())
+ return false;
+
+ printing::PrintViewManagerBasic::CreateForWebContents(web_contents());
+ printing::PrintViewManagerBasic* print_view_manager =
+ printing::PrintViewManagerBasic::FromWebContents(web_contents());
+ if (print_view_manager == NULL)
+ return false;
+
+ print_view_manager->PrintNow();
+ return true;
+}
+
bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}

Powered by Google App Engine
This is Rietveld 408576698