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 "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
6 #include "ppapi/c/private/ppb_flash_clipboard.h" | 6 #include "ppapi/c/private/ppb_flash_clipboard.h" |
7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
9 #include "ppapi/thunk/ppb_flash_clipboard_api.h" | 9 #include "ppapi/thunk/ppb_flash_clipboard_api.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 if (enter.failed()) | 30 if (enter.failed()) |
31 return PP_MakeUndefined(); | 31 return PP_MakeUndefined(); |
32 return enter.functions()->ReadPlainText(instance, clipboard_type); | 32 return enter.functions()->ReadPlainText(instance, clipboard_type); |
33 } | 33 } |
34 | 34 |
35 int32_t WritePlainText(PP_Instance instance, | 35 int32_t WritePlainText(PP_Instance instance, |
36 PP_Flash_Clipboard_Type clipboard_type, | 36 PP_Flash_Clipboard_Type clipboard_type, |
37 PP_Var text) { | 37 PP_Var text) { |
38 EnterFlashClipboard enter(instance, true); | 38 EnterFlashClipboard enter(instance, true); |
39 if (enter.failed()) | 39 if (enter.failed()) |
40 return PP_ERROR_NOINTERFACE; | 40 return enter.retval(); |
41 return enter.functions()->WritePlainText(instance, clipboard_type, text); | 41 return enter.functions()->WritePlainText(instance, clipboard_type, text); |
42 } | 42 } |
43 | 43 |
44 const PPB_Flash_Clipboard g_ppb_flash_clipboard_thunk = { | 44 const PPB_Flash_Clipboard g_ppb_flash_clipboard_thunk = { |
45 &IsFormatAvailable, | 45 &IsFormatAvailable, |
46 &ReadPlainText, | 46 &ReadPlainText, |
47 &WritePlainText | 47 &WritePlainText |
48 }; | 48 }; |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 const PPB_Flash_Clipboard_3_0* GetPPB_Flash_Clipboard_3_0_Thunk() { | 52 const PPB_Flash_Clipboard_3_0* GetPPB_Flash_Clipboard_3_0_Thunk() { |
53 return &g_ppb_flash_clipboard_thunk; | 53 return &g_ppb_flash_clipboard_thunk; |
54 } | 54 } |
55 | 55 |
56 } // namespace thunk | 56 } // namespace thunk |
57 } // namespace ppapi | 57 } // namespace ppapi |
OLD | NEW |