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

Side by Side Diff: ppapi/proxy/printing_resource.cc

Issue 10826072: Implement browser side of PPB_Printing resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/tests/test_printing.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ppapi/proxy/printing_resource.h" 5 #include "ppapi/proxy/printing_resource.h"
6 6
7 #include "ipc/ipc_message.h" 7 #include "ipc/ipc_message.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/dispatch_reply_message.h" 9 #include "ppapi/proxy/dispatch_reply_message.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 16 matching lines...) Expand all
27 27
28 int32_t PrintingResource::GetDefaultPrintSettings( 28 int32_t PrintingResource::GetDefaultPrintSettings(
29 PP_PrintSettings_Dev* print_settings, 29 PP_PrintSettings_Dev* print_settings,
30 scoped_refptr<TrackedCallback> callback) { 30 scoped_refptr<TrackedCallback> callback) {
31 if (!print_settings) 31 if (!print_settings)
32 return PP_ERROR_BADARGUMENT; 32 return PP_ERROR_BADARGUMENT;
33 33
34 if (TrackedCallback::IsPending(callback_)) 34 if (TrackedCallback::IsPending(callback_))
35 return PP_ERROR_INPROGRESS; 35 return PP_ERROR_INPROGRESS;
36 36
37 if (!sent_create_to_renderer()) 37 if (!sent_create_to_browser())
38 SendCreateToBrowser(PpapiHostMsg_Printing_Create()); 38 SendCreateToBrowser(PpapiHostMsg_Printing_Create());
39 39
40 DCHECK(!print_settings_); 40 DCHECK(!print_settings_);
41 print_settings_ = print_settings; 41 print_settings_ = print_settings;
42 callback_ = callback; 42 callback_ = callback;
43 43
44 CallBrowser(PpapiHostMsg_Printing_GetDefaultPrintSettings()); 44 CallBrowser(PpapiHostMsg_Printing_GetDefaultPrintSettings());
45 return PP_OK_COMPLETIONPENDING; 45 return PP_OK_COMPLETIONPENDING;
46 } 46 }
47 47
(...skipping 14 matching lines...) Expand all
62 *print_settings_ = settings; 62 *print_settings_ = settings;
63 print_settings_ = NULL; 63 print_settings_ = NULL;
64 64
65 // Notify the plugin of the new data. 65 // Notify the plugin of the new data.
66 TrackedCallback::ClearAndRun(&callback_, params.result()); 66 TrackedCallback::ClearAndRun(&callback_, params.result());
67 // DANGER: May delete |this|! 67 // DANGER: May delete |this|!
68 } 68 }
69 69
70 } // namespace proxy 70 } // namespace proxy
71 } // namespace ppapi 71 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/tests/test_printing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698