OLD | NEW |
1 // Copyright 2009, Google Inc. All rights reserved. | 1 // Copyright 2009, Google Inc. All rights reserved. |
2 // Portions of this file were adapted from the Mozilla project. | 2 // Portions of this file were adapted from the Mozilla project. |
3 // See https://developer.mozilla.org/en/ActiveX_Control_for_Hosting_Netscape_Plu
g-ins_in_IE | 3 // See https://developer.mozilla.org/en/ActiveX_Control_for_Hosting_Netscape_Plu
g-ins_in_IE |
4 /* ***** BEGIN LICENSE BLOCK ***** | 4 /* ***** BEGIN LICENSE BLOCK ***** |
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
6 * | 6 * |
7 * The contents of this file are subject to the Mozilla Public License Version | 7 * The contents of this file are subject to the Mozilla Public License Version |
8 * 1.1 (the "License"); you may not use this file except in compliance with | 8 * 1.1 (the "License"); you may not use this file except in compliance with |
9 * the License. You may obtain a copy of the License at | 9 * the License. You may obtain a copy of the License at |
10 * http://www.mozilla.org/MPL/ | 10 * http://www.mozilla.org/MPL/ |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // See: http://msdn.microsoft.com/en-us/library/aa768191(VS.85).aspx | 546 // See: http://msdn.microsoft.com/en-us/library/aa768191(VS.85).aspx |
547 CoTaskMemFree(property.pstrName); | 547 CoTaskMemFree(property.pstrName); |
548 } | 548 } |
549 } | 549 } |
550 } | 550 } |
551 } | 551 } |
552 | 552 |
553 return IPersistPropertyBagImpl<CHostControl>::Load(property_bag, error_log); | 553 return IPersistPropertyBagImpl<CHostControl>::Load(property_bag, error_log); |
554 } | 554 } |
555 | 555 |
| 556 STDMETHODIMP CHostControl::SetObjectRects(LPCRECT lprcPosRect, |
| 557 LPCRECT lprcClipRect) { |
| 558 if (plugin_proxy_.get()) { |
| 559 NPWindow window = {0}; |
| 560 window.window = m_hWnd; |
| 561 window.type = NPWindowTypeWindow; |
| 562 window.x = lprcPosRect->left; |
| 563 window.y = lprcPosRect->top; |
| 564 window.width = lprcPosRect->right - lprcPosRect->left; |
| 565 window.height = lprcPosRect->bottom - lprcPosRect->top; |
| 566 if (!plugin_proxy_->SetWindow(window)) { |
| 567 return E_FAIL; |
| 568 } |
| 569 } |
| 570 |
| 571 return IOleInPlaceObjectWindowlessImpl::SetObjectRects(lprcPosRect, |
| 572 lprcClipRect); |
| 573 } |
| 574 |
556 HRESULT CHostControl::GetStringProperty(NPPVariable np_property_variable, | 575 HRESULT CHostControl::GetStringProperty(NPPVariable np_property_variable, |
557 BSTR* string) { | 576 BSTR* string) { |
558 HRESULT hr; | 577 HRESULT hr; |
559 if (FAILED(hr = ConstructPluginProxy())) { | 578 if (FAILED(hr = ConstructPluginProxy())) { |
560 return hr; | 579 return hr; |
561 } | 580 } |
562 | 581 |
563 char* property = NULL; | 582 char* property = NULL; |
564 if (NPERR_NO_ERROR != plugin_proxy_->GetPluginFunctions()->getvalue( | 583 if (NPERR_NO_ERROR != plugin_proxy_->GetPluginFunctions()->getvalue( |
565 NULL, | 584 NULL, |
(...skipping 26 matching lines...) Expand all Loading... |
592 | 611 |
593 HRESULT hr; | 612 HRESULT hr; |
594 NPPluginProxy* plugin_proxy = NULL; | 613 NPPluginProxy* plugin_proxy = NULL; |
595 if (FAILED(hr = NPPluginProxy::Create(&plugin_proxy))) { | 614 if (FAILED(hr = NPPluginProxy::Create(&plugin_proxy))) { |
596 return hr; | 615 return hr; |
597 } | 616 } |
598 | 617 |
599 plugin_proxy_.reset(plugin_proxy); | 618 plugin_proxy_.reset(plugin_proxy); |
600 return S_OK; | 619 return S_OK; |
601 } | 620 } |
OLD | NEW |