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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const BrowserPluginHostMsg_CreateGuest_Params& params) { | 115 const BrowserPluginHostMsg_CreateGuest_Params& params) { |
116 RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create")); | 116 RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create")); |
117 if (factory_) { | 117 if (factory_) { |
118 return factory_->CreateBrowserPluginGuest(instance_id, | 118 return factory_->CreateBrowserPluginGuest(instance_id, |
119 web_contents, | 119 web_contents, |
120 params); | 120 params); |
121 } | 121 } |
122 return new BrowserPluginGuest(instance_id, web_contents,params); | 122 return new BrowserPluginGuest(instance_id, web_contents,params); |
123 } | 123 } |
124 | 124 |
| 125 void BrowserPluginGuest::Destroy() { |
| 126 GetContentClient()->browser()->GuestWebContentsDestroyed( |
| 127 web_contents(), embedder_web_contents_); |
| 128 } |
| 129 |
125 void BrowserPluginGuest::UpdateVisibility() { | 130 void BrowserPluginGuest::UpdateVisibility() { |
126 OnSetVisibility(instance_id_, visible()); | 131 OnSetVisibility(instance_id_, visible()); |
127 } | 132 } |
128 | 133 |
129 void BrowserPluginGuest::Observe(int type, | 134 void BrowserPluginGuest::Observe(int type, |
130 const NotificationSource& source, | 135 const NotificationSource& source, |
131 const NotificationDetails& details) { | 136 const NotificationDetails& details) { |
132 switch (type) { | 137 switch (type) { |
133 case NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { | 138 case NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { |
134 DCHECK_EQ(Source<WebContents>(source).ptr(), web_contents()); | 139 DCHECK_EQ(Source<WebContents>(source).ptr(), web_contents()); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 relay_params.scroll_delta = params.scroll_delta; | 731 relay_params.scroll_delta = params.scroll_delta; |
727 relay_params.scroll_rect = params.scroll_rect; | 732 relay_params.scroll_rect = params.scroll_rect; |
728 relay_params.copy_rects = params.copy_rects; | 733 relay_params.copy_rects = params.copy_rects; |
729 | 734 |
730 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), | 735 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), |
731 instance_id(), | 736 instance_id(), |
732 relay_params)); | 737 relay_params)); |
733 } | 738 } |
734 | 739 |
735 } // namespace content | 740 } // namespace content |
OLD | NEW |