| 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 "content/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 container_ = container; | 810 container_ = container; |
| 811 container_->setWantsWheelEvents(true); | 811 container_->setWantsWheelEvents(true); |
| 812 return true; | 812 return true; |
| 813 } | 813 } |
| 814 | 814 |
| 815 void BrowserPlugin::EnableCompositing(bool enable) { | 815 void BrowserPlugin::EnableCompositing(bool enable) { |
| 816 if (compositing_enabled_ == enable) | 816 if (compositing_enabled_ == enable) |
| 817 return; | 817 return; |
| 818 | 818 |
| 819 if (enable && !compositing_helper_) { | 819 if (enable && !compositing_helper_) { |
| 820 compositing_helper_.reset(new BrowserPluginCompositingHelper( | 820 compositing_helper_ = new BrowserPluginCompositingHelper( |
| 821 container_, | 821 container_, |
| 822 render_view_routing_id_)); | 822 render_view_routing_id_); |
| 823 } | 823 } |
| 824 | 824 |
| 825 compositing_helper_->EnableCompositing(enable); | 825 compositing_helper_->EnableCompositing(enable); |
| 826 compositing_enabled_ = enable; | 826 compositing_enabled_ = enable; |
| 827 } | 827 } |
| 828 | 828 |
| 829 void BrowserPlugin::destroy() { | 829 void BrowserPlugin::destroy() { |
| 830 // The BrowserPlugin's WebPluginContainer is deleted immediately after this | 830 // The BrowserPlugin's WebPluginContainer is deleted immediately after this |
| 831 // call returns, so let's not keep a reference to it around. | 831 // call returns, so let's not keep a reference to it around. |
| 832 container_ = NULL; | 832 container_ = NULL; |
| 833 compositing_helper_.reset(); | 833 if (compositing_helper_) |
| 834 compositing_helper_->OnContainerDestroy(); |
| 834 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 835 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 835 } | 836 } |
| 836 | 837 |
| 837 NPObject* BrowserPlugin::scriptableObject() { | 838 NPObject* BrowserPlugin::scriptableObject() { |
| 838 NPObject* browser_plugin_np_object(bindings_->np_object()); | 839 NPObject* browser_plugin_np_object(bindings_->np_object()); |
| 839 // The object is expected to be retained before it is returned. | 840 // The object is expected to be retained before it is returned. |
| 840 WebKit::WebBindings::retainObject(browser_plugin_np_object); | 841 WebKit::WebBindings::retainObject(browser_plugin_np_object); |
| 841 return browser_plugin_np_object; | 842 return browser_plugin_np_object; |
| 842 } | 843 } |
| 843 | 844 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 void* notify_data) { | 1100 void* notify_data) { |
| 1100 } | 1101 } |
| 1101 | 1102 |
| 1102 void BrowserPlugin::didFailLoadingFrameRequest( | 1103 void BrowserPlugin::didFailLoadingFrameRequest( |
| 1103 const WebKit::WebURL& url, | 1104 const WebKit::WebURL& url, |
| 1104 void* notify_data, | 1105 void* notify_data, |
| 1105 const WebKit::WebURLError& error) { | 1106 const WebKit::WebURLError& error) { |
| 1106 } | 1107 } |
| 1107 | 1108 |
| 1108 } // namespace content | 1109 } // namespace content |
| OLD | NEW |