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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/safe_numerics.h" | 9 #include "base/safe_numerics.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 PP_Var message) { | 402 PP_Var message) { |
403 content::PepperPluginInstance* instance = | 403 content::PepperPluginInstance* instance = |
404 content::PepperPluginInstance::Get(instance_id); | 404 content::PepperPluginInstance::Get(instance_id); |
405 if (!instance) | 405 if (!instance) |
406 return PP_MakeUndefined(); | 406 return PP_MakeUndefined(); |
407 | 407 |
408 std::string actual_value; | 408 std::string actual_value; |
409 scoped_refptr<ppapi::StringVar> message_string( | 409 scoped_refptr<ppapi::StringVar> message_string( |
410 ppapi::StringVar::FromPPVar(message)); | 410 ppapi::StringVar::FromPPVar(message)); |
411 | 411 |
412 instance->GetRenderView()->Send( | 412 IPC::SyncMessage* msg = new ChromeViewHostMsg_PDFModalPromptForPassword( |
413 new ChromeViewHostMsg_PDFModalPromptForPassword( | 413 instance->GetRenderView()->GetRoutingID(), |
414 instance->GetRenderView()->GetRoutingID(), | 414 message_string->value(), |
415 message_string->value(), | 415 &actual_value); |
416 &actual_value)); | 416 msg->EnableMessagePumping(); |
| 417 instance->GetRenderView()->Send(msg); |
417 | 418 |
418 return ppapi::StringVar::StringToPPVar(actual_value); | 419 return ppapi::StringVar::StringToPPVar(actual_value); |
419 } | 420 } |
420 | 421 |
421 const PPB_PDF ppb_pdf = { | 422 const PPB_PDF ppb_pdf = { |
422 &GetLocalizedString, | 423 &GetLocalizedString, |
423 &GetResourceImage, | 424 &GetResourceImage, |
424 &GetFontFileWithFallback, | 425 &GetFontFileWithFallback, |
425 &GetFontTableForPrivateFontFile, | 426 &GetFontTableForPrivateFontFile, |
426 &SearchString, | 427 &SearchString, |
(...skipping 19 matching lines...) Expand all Loading... |
446 | 447 |
447 // static | 448 // static |
448 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { | 449 void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { |
449 #if defined(ENABLE_FULL_PRINTING) | 450 #if defined(ENABLE_FULL_PRINTING) |
450 WebKit::WebElement element = GetWebElement(instance_id); | 451 WebKit::WebElement element = GetWebElement(instance_id); |
451 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); | 452 printing::PrintWebViewHelper* helper = GetPrintWebViewHelper(element); |
452 if (helper) | 453 if (helper) |
453 helper->PrintNode(element); | 454 helper->PrintNode(element); |
454 #endif // ENABLE_FULL_PRINTING | 455 #endif // ENABLE_FULL_PRINTING |
455 } | 456 } |
OLD | NEW |