| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/npapi_extension_thunk.h" | 5 #include "webkit/glue/plugins/npapi_extension_thunk.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "third_party/npapi/bindings/npapi_extensions.h" | 10 #include "third_party/npapi/bindings/npapi_extensions.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 static NPError NPSetCursor(NPP id, NPCursorType type) { | 520 static NPError NPSetCursor(NPP id, NPCursorType type) { |
| 521 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); | 521 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 522 if (!plugin) | 522 if (!plugin) |
| 523 return NPERR_GENERIC_ERROR; | 523 return NPERR_GENERIC_ERROR; |
| 524 | 524 |
| 525 return plugin->webplugin()->delegate()->SetCursor(type) ? | 525 return plugin->webplugin()->delegate()->SetCursor(type) ? |
| 526 NPERR_NO_ERROR : NPERR_GENERIC_ERROR; | 526 NPERR_NO_ERROR : NPERR_GENERIC_ERROR; |
| 527 } | 527 } |
| 528 | 528 |
| 529 static NPFontExtensions* GetFontExtensions(NPP id) { |
| 530 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 531 if (!plugin) |
| 532 return NULL; |
| 533 |
| 534 return plugin->webplugin()->delegate()->GetFontExtensions(); |
| 535 } |
| 536 |
| 529 namespace NPAPI { | 537 namespace NPAPI { |
| 530 | 538 |
| 531 NPError GetPepperExtensionsFunctions(void* value) { | 539 NPError GetPepperExtensionsFunctions(void* value) { |
| 532 static const NPNExtensions kExtensions = { | 540 static const NPNExtensions kExtensions = { |
| 533 &AcquireDevice, | 541 &AcquireDevice, |
| 534 &CopyTextToClipboard, | 542 &CopyTextToClipboard, |
| 535 &NumberOfFindResultsChanged, | 543 &NumberOfFindResultsChanged, |
| 536 &SelectedFindResultChanged, | 544 &SelectedFindResultChanged, |
| 537 &ChooseFile, | 545 &ChooseFile, |
| 538 &GetWidgetExtensions, | 546 &GetWidgetExtensions, |
| 539 &NPSetCursor, | 547 &NPSetCursor, |
| 548 &GetFontExtensions, |
| 540 }; | 549 }; |
| 541 | 550 |
| 542 // Return a pointer to the canonical function table. | 551 // Return a pointer to the canonical function table. |
| 543 NPNExtensions* extensions = const_cast<NPNExtensions*>(&kExtensions); | 552 NPNExtensions* extensions = const_cast<NPNExtensions*>(&kExtensions); |
| 544 NPNExtensions** exts = reinterpret_cast<NPNExtensions**>(value); | 553 NPNExtensions** exts = reinterpret_cast<NPNExtensions**>(value); |
| 545 *exts = extensions; | 554 *exts = extensions; |
| 546 return NPERR_NO_ERROR; | 555 return NPERR_NO_ERROR; |
| 547 } | 556 } |
| 548 | 557 |
| 549 } // namespace NPAPI | 558 } // namespace NPAPI |
| OLD | NEW |