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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months 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 unified diff | Download patch
OLDNEW
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
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::GetNumCopies() {
1703 DCHECK(plugin_print_interface_);
1704 if (!plugin_print_interface_)
1705 return 1;
1706 return plugin_print_interface_->NumCopies(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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698