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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 return GetPreferredPrintOutputFormat(&format); | 1692 return GetPreferredPrintOutputFormat(&format); |
1693 } | 1693 } |
1694 | 1694 |
1695 bool PepperPluginInstanceImpl::IsPrintScalingDisabled() { | 1695 bool PepperPluginInstanceImpl::IsPrintScalingDisabled() { |
1696 DCHECK(plugin_print_interface_); | 1696 DCHECK(plugin_print_interface_); |
1697 if (!plugin_print_interface_) | 1697 if (!plugin_print_interface_) |
1698 return false; | 1698 return false; |
1699 return plugin_print_interface_->IsScalingDisabled(pp_instance()) == PP_TRUE; | 1699 return plugin_print_interface_->IsScalingDisabled(pp_instance()) == PP_TRUE; |
1700 } | 1700 } |
1701 | 1701 |
| 1702 int PepperPluginInstanceImpl::GetCopiesToPrint() { |
| 1703 DCHECK(plugin_print_interface_); |
| 1704 if (!plugin_print_interface_) |
| 1705 return 1; |
| 1706 return plugin_print_interface_->GetCopiesToPrint(pp_instance()); |
| 1707 } |
| 1708 |
1702 int PepperPluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) { | 1709 int PepperPluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) { |
1703 // Keep a reference on the stack. See NOTE above. | 1710 // Keep a reference on the stack. See NOTE above. |
1704 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 1711 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
1705 PP_PrintOutputFormat_Dev format; | 1712 PP_PrintOutputFormat_Dev format; |
1706 if (!GetPreferredPrintOutputFormat(&format)) { | 1713 if (!GetPreferredPrintOutputFormat(&format)) { |
1707 // PrintBegin should not have been called since SupportsPrintInterface | 1714 // PrintBegin should not have been called since SupportsPrintInterface |
1708 // would have returned false; | 1715 // would have returned false; |
1709 NOTREACHED(); | 1716 NOTREACHED(); |
1710 return 0; | 1717 return 0; |
1711 } | 1718 } |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 // Running out-of-process. Initiate an IPC call to notify the plugin | 3313 // Running out-of-process. Initiate an IPC call to notify the plugin |
3307 // process. | 3314 // process. |
3308 ppapi::proxy::HostDispatcher* dispatcher = | 3315 ppapi::proxy::HostDispatcher* dispatcher = |
3309 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3316 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3310 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3317 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3311 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3318 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3312 } | 3319 } |
3313 } | 3320 } |
3314 | 3321 |
3315 } // namespace content | 3322 } // namespace content |
OLD | NEW |