| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #define PEPPER_APIS_ENABLED 1 | 5 #define PEPPER_APIS_ENABLED 1 |
| 6 | 6 |
| 7 #include "chrome/renderer/webplugin_delegate_pepper.h" | 7 #include "chrome/renderer/webplugin_delegate_pepper.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 void WebPluginDelegatePepper::PluginDestroyed() { | 581 void WebPluginDelegatePepper::PluginDestroyed() { |
| 582 if (nested_delegate_) { | 582 if (nested_delegate_) { |
| 583 nested_delegate_->PluginDestroyed(); | 583 nested_delegate_->PluginDestroyed(); |
| 584 nested_delegate_ = NULL; | 584 nested_delegate_ = NULL; |
| 585 } | 585 } |
| 586 delete this; | 586 delete this; |
| 587 } | 587 } |
| 588 | 588 |
| 589 void WebPluginDelegatePepper::Paint(WebKit::WebCanvas* canvas, | 589 void WebPluginDelegatePepper::Paint(WebKit::WebCanvas* canvas, |
| 590 const gfx::Rect& rect) { | 590 const gfx::Rect& rect) { |
| 591 #if defined(OS_WIN) || defined(OS_LINUX) | 591 #if defined(OS_WIN) |
| 592 if (nested_delegate_) { | 592 if (nested_delegate_) { |
| 593 // TODO(apatrick): The GPU plugin will render to an offscreen render target. | 593 // TODO(apatrick): The GPU plugin will render to an offscreen render target. |
| 594 // Need to copy it to the screen here. | 594 // Need to copy it to the screen here. |
| 595 } else { | 595 } else { |
| 596 // Blit from background_context to context. | 596 // Blit from background_context to context. |
| 597 if (!committed_bitmap_.isNull()) { | 597 if (!committed_bitmap_.isNull()) { |
| 598 gfx::Point origin(window_rect_.origin().x(), window_rect_.origin().y()); | 598 gfx::Point origin(window_rect_.origin().x(), window_rect_.origin().y()); |
| 599 canvas->drawBitmap(committed_bitmap_, | 599 canvas->drawBitmap(committed_bitmap_, |
| 600 SkIntToScalar(window_rect_.origin().x()), | 600 SkIntToScalar(window_rect_.origin().x()), |
| 601 SkIntToScalar(window_rect_.origin().y())); | 601 SkIntToScalar(window_rect_.origin().y())); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 BuildCharEvent(&event, &npevent); | 726 BuildCharEvent(&event, &npevent); |
| 727 break; | 727 break; |
| 728 case NPEventType_Minimize: | 728 case NPEventType_Minimize: |
| 729 case NPEventType_Focus: | 729 case NPEventType_Focus: |
| 730 case NPEventType_Device: | 730 case NPEventType_Device: |
| 731 // NOTIMPLEMENTED(); | 731 // NOTIMPLEMENTED(); |
| 732 break; | 732 break; |
| 733 } | 733 } |
| 734 return instance()->NPP_HandleEvent(&npevent) != 0; | 734 return instance()->NPP_HandleEvent(&npevent) != 0; |
| 735 } | 735 } |
| OLD | NEW |