| 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/browser/renderer_host/pepper/pepper_printing_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_printing_host.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "ppapi/c/dev/pp_print_settings_dev.h" | 9 #include "ppapi/c/dev/pp_print_settings_dev.h" |
| 8 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/host/dispatch_host_message.h" | 11 #include "ppapi/host/dispatch_host_message.h" |
| 10 #include "ppapi/host/host_message_context.h" | 12 #include "ppapi/host/host_message_context.h" |
| 11 #include "ppapi/host/ppapi_host.h" | 13 #include "ppapi/host/ppapi_host.h" |
| 12 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 13 | 15 |
| 14 namespace content { | 16 namespace content { |
| 15 | 17 |
| 16 PepperPrintingHost::PepperPrintingHost( | 18 PepperPrintingHost::PepperPrintingHost( |
| 17 ppapi::host::PpapiHost* host, | 19 ppapi::host::PpapiHost* host, |
| 18 PP_Instance instance, | 20 PP_Instance instance, |
| 19 PP_Resource resource, | 21 PP_Resource resource, |
| 20 scoped_ptr<PepperPrintSettingsManager> print_settings_manager) | 22 scoped_ptr<PepperPrintSettingsManager> print_settings_manager) |
| 21 : ResourceHost(host, instance, resource), | 23 : ResourceHost(host, instance, resource), |
| 22 print_settings_manager_(print_settings_manager.Pass()), | 24 print_settings_manager_(std::move(print_settings_manager)), |
| 23 weak_factory_(this) {} | 25 weak_factory_(this) {} |
| 24 | 26 |
| 25 PepperPrintingHost::~PepperPrintingHost() {} | 27 PepperPrintingHost::~PepperPrintingHost() {} |
| 26 | 28 |
| 27 int32_t PepperPrintingHost::OnResourceMessageReceived( | 29 int32_t PepperPrintingHost::OnResourceMessageReceived( |
| 28 const IPC::Message& msg, | 30 const IPC::Message& msg, |
| 29 ppapi::host::HostMessageContext* context) { | 31 ppapi::host::HostMessageContext* context) { |
| 30 PPAPI_BEGIN_MESSAGE_MAP(PepperPrintingHost, msg) | 32 PPAPI_BEGIN_MESSAGE_MAP(PepperPrintingHost, msg) |
| 31 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( | 33 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( |
| 32 PpapiHostMsg_Printing_GetDefaultPrintSettings, | 34 PpapiHostMsg_Printing_GetDefaultPrintSettings, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 47 void PepperPrintingHost::PrintSettingsCallback( | 49 void PepperPrintingHost::PrintSettingsCallback( |
| 48 ppapi::host::ReplyMessageContext reply_context, | 50 ppapi::host::ReplyMessageContext reply_context, |
| 49 PepperPrintSettingsManager::Result result) { | 51 PepperPrintSettingsManager::Result result) { |
| 50 reply_context.params.set_result(result.second); | 52 reply_context.params.set_result(result.second); |
| 51 host()->SendReply( | 53 host()->SendReply( |
| 52 reply_context, | 54 reply_context, |
| 53 PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply(result.first)); | 55 PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply(result.first)); |
| 54 } | 56 } |
| 55 | 57 |
| 56 } // namespace content | 58 } // namespace content |
| OLD | NEW |