| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 if (factory_) { | 176 if (factory_) { |
| 177 return factory_->CreateBrowserPluginGuest(instance_id, | 177 return factory_->CreateBrowserPluginGuest(instance_id, |
| 178 embedder_web_contents, | 178 embedder_web_contents, |
| 179 web_contents, | 179 web_contents, |
| 180 params); | 180 params); |
| 181 } | 181 } |
| 182 return new BrowserPluginGuest(instance_id, embedder_web_contents, | 182 return new BrowserPluginGuest(instance_id, embedder_web_contents, |
| 183 web_contents, params); | 183 web_contents, params); |
| 184 } | 184 } |
| 185 | 185 |
| 186 RenderWidgetHostView* BrowserPluginGuest::GetEmbedderRenderWidgetHostView() { |
| 187 return embedder_web_contents_->GetRenderWidgetHostView(); |
| 188 } |
| 189 |
| 186 void BrowserPluginGuest::UpdateVisibility() { | 190 void BrowserPluginGuest::UpdateVisibility() { |
| 187 OnSetVisibility(instance_id_, visible()); | 191 OnSetVisibility(instance_id_, visible()); |
| 188 } | 192 } |
| 189 | 193 |
| 190 void BrowserPluginGuest::Observe(int type, | 194 void BrowserPluginGuest::Observe(int type, |
| 191 const NotificationSource& source, | 195 const NotificationSource& source, |
| 192 const NotificationDetails& details) { | 196 const NotificationDetails& details) { |
| 193 switch (type) { | 197 switch (type) { |
| 194 case NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { | 198 case NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: { |
| 195 DCHECK_EQ(Source<WebContents>(source).ptr(), web_contents()); | 199 DCHECK_EQ(Source<WebContents>(source).ptr(), web_contents()); |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 relay_params.scroll_delta = params.scroll_delta; | 834 relay_params.scroll_delta = params.scroll_delta; |
| 831 relay_params.scroll_rect = params.scroll_rect; | 835 relay_params.scroll_rect = params.scroll_rect; |
| 832 relay_params.copy_rects = params.copy_rects; | 836 relay_params.copy_rects = params.copy_rects; |
| 833 | 837 |
| 834 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), | 838 SendMessageToEmbedder(new BrowserPluginMsg_UpdateRect(embedder_routing_id(), |
| 835 instance_id(), | 839 instance_id(), |
| 836 relay_params)); | 840 relay_params)); |
| 837 } | 841 } |
| 838 | 842 |
| 839 } // namespace content | 843 } // namespace content |
| OLD | NEW |