Chromium Code Reviews| 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); |
| } |