| 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 #include "chrome/plugin/webplugin_proxy.h" | 5 #include "chrome/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "skia/ext/platform_device.h" | 27 #include "skia/ext/platform_device.h" |
| 28 #include "webkit/api/public/WebBindings.h" | 28 #include "webkit/api/public/WebBindings.h" |
| 29 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 29 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 30 #include "webkit/glue/webplugin_delegate.h" | 30 #include "webkit/glue/webplugin_delegate.h" |
| 31 | 31 |
| 32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 33 #include "base/gfx/gdi_util.h" | 33 #include "base/gfx/gdi_util.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 using WebKit::WebBindings; | 36 using WebKit::WebBindings; |
| 37 using webkit_glue::WebPluginDelegate; |
| 38 using webkit_glue::WebPluginResourceClient; |
| 37 | 39 |
| 38 typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap; | 40 typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap; |
| 39 static ContextMap& GetContextMap() { | 41 static ContextMap& GetContextMap() { |
| 40 return *Singleton<ContextMap>::get(); | 42 return *Singleton<ContextMap>::get(); |
| 41 } | 43 } |
| 42 | 44 |
| 43 WebPluginProxy::WebPluginProxy( | 45 WebPluginProxy::WebPluginProxy( |
| 44 PluginChannel* channel, | 46 PluginChannel* channel, |
| 45 int route_id, | 47 int route_id, |
| 46 WebPluginDelegate* delegate, | |
| 47 const GURL& page_url) | 48 const GURL& page_url) |
| 48 : channel_(channel), | 49 : channel_(channel), |
| 49 route_id_(route_id), | 50 route_id_(route_id), |
| 50 cp_browsing_context_(0), | 51 cp_browsing_context_(0), |
| 51 window_npobject_(NULL), | 52 window_npobject_(NULL), |
| 52 plugin_element_(NULL), | 53 plugin_element_(NULL), |
| 53 delegate_(delegate), | 54 delegate_(NULL), |
| 54 waiting_for_paint_(false), | 55 waiting_for_paint_(false), |
| 55 page_url_(page_url), | 56 page_url_(page_url), |
| 56 ALLOW_THIS_IN_INITIALIZER_LIST(runnable_method_factory_(this)) | 57 ALLOW_THIS_IN_INITIALIZER_LIST(runnable_method_factory_(this)) |
| 57 { | 58 { |
| 58 } | 59 } |
| 59 | 60 |
| 60 WebPluginProxy::~WebPluginProxy() { | 61 WebPluginProxy::~WebPluginProxy() { |
| 61 if (cp_browsing_context_) | 62 if (cp_browsing_context_) |
| 62 GetContextMap().erase(cp_browsing_context_); | 63 GetContextMap().erase(cp_browsing_context_); |
| 63 } | 64 } |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 while (index != resource_clients_.end()) { | 653 while (index != resource_clients_.end()) { |
| 653 WebPluginResourceClient* client = (*index).second; | 654 WebPluginResourceClient* client = (*index).second; |
| 654 | 655 |
| 655 if (client == resource_client) { | 656 if (client == resource_client) { |
| 656 resource_clients_.erase(index++); | 657 resource_clients_.erase(index++); |
| 657 } else { | 658 } else { |
| 658 index++; | 659 index++; |
| 659 } | 660 } |
| 660 } | 661 } |
| 661 } | 662 } |
| OLD | NEW |