| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/pepper/ppb_pdf_impl.h" | 5 #include "chrome/renderer/pepper/ppb_pdf_impl.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 365 |
| 366 } // namespace | 366 } // namespace |
| 367 | 367 |
| 368 // static | 368 // static |
| 369 const PPB_PDF* PPB_PDF_Impl::GetInterface() { | 369 const PPB_PDF* PPB_PDF_Impl::GetInterface() { |
| 370 return &ppb_pdf; | 370 return &ppb_pdf; |
| 371 } | 371 } |
| 372 | 372 |
| 373 // static | 373 // static |
| 374 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { | 374 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { |
| 375 #if defined(ENABLE_PRINTING) |
| 375 PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); | 376 PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); |
| 376 if (!instance) | 377 if (!instance) |
| 377 return; | 378 return; |
| 378 | 379 |
| 379 WebKit::WebElement element = instance->container()->element(); | 380 WebKit::WebElement element = instance->container()->element(); |
| 380 WebKit::WebView* view = element.document().frame()->view(); | 381 WebKit::WebView* view = element.document().frame()->view(); |
| 381 content::RenderView* render_view = content::RenderView::FromWebView(view); | 382 content::RenderView* render_view = content::RenderView::FromWebView(view); |
| 382 | 383 |
| 383 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); | 384 PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); |
| 384 if (print_view_helper) | 385 if (print_view_helper) |
| 385 print_view_helper->PrintNode(element); | 386 print_view_helper->PrintNode(element); |
| 387 #endif |
| 386 } | 388 } |
| OLD | NEW |