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_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 RenderViewHost* render_view_host, | 115 RenderViewHost* render_view_host, |
116 int instance_id, | 116 int instance_id, |
117 const std::string& src, | 117 const std::string& src, |
118 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { | 118 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
119 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 119 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
120 CHECK(guest); | 120 CHECK(guest); |
121 GURL url(src); | 121 GURL url(src); |
122 WebContentsImpl* guest_web_contents = | 122 WebContentsImpl* guest_web_contents = |
123 static_cast<WebContentsImpl*>(guest->GetWebContents()); | 123 static_cast<WebContentsImpl*>(guest->GetWebContents()); |
124 | 124 |
125 // We ignore loading empty urls in web_contents. | 125 // We do not load empty urls in web_contents. |
126 // If a guest sets empty src attribute after it has navigated to some | 126 // If a guest sets empty src attribute after it has navigated to some |
127 // non-empty page, the action is considered no-op. | 127 // non-empty page, the action is considered no-op. This empty src navigation |
128 // TODO(lazyboy): The js shim for browser-plugin might need to reflect empty | 128 // should never be sent to BrowserPluginEmbedder (browser process). |
129 // src ignoring in the shadow DOM element: http://crbug.com/149001. | 129 CHECK(!src.empty()); |
Charlie Reis
2012/10/15 18:57:28
Hmm, we've got a few problems here, actually. Kee
lazyboy
2012/10/15 20:45:57
Done.
| |
130 if (!src.empty()) { | 130 guest_web_contents->GetController().LoadURL(url, |
131 guest_web_contents->GetController().LoadURL(url, | 131 Referrer(), |
132 Referrer(), | 132 PAGE_TRANSITION_AUTO_SUBFRAME, |
133 PAGE_TRANSITION_AUTO_SUBFRAME, | 133 std::string()); |
134 std::string()); | |
135 } | |
136 | 134 |
137 // Resize the guest if the resize parameter was set from the renderer. | 135 // Resize the guest if the resize parameter was set from the renderer. |
138 ResizeGuest(render_view_host, instance_id, resize_params); | 136 ResizeGuest(render_view_host, instance_id, resize_params); |
139 } | 137 } |
140 | 138 |
141 void BrowserPluginEmbedder::UpdateRectACK(int instance_id, | 139 void BrowserPluginEmbedder::UpdateRectACK(int instance_id, |
142 int message_id, | 140 int message_id, |
143 const gfx::Size& size) { | 141 const gfx::Size& size) { |
144 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 142 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
145 if (guest) | 143 if (guest) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 bool visible = *Details<bool>(details).ptr(); | 302 bool visible = *Details<bool>(details).ptr(); |
305 WebContentsVisibilityChanged(visible); | 303 WebContentsVisibilityChanged(visible); |
306 break; | 304 break; |
307 } | 305 } |
308 default: | 306 default: |
309 NOTREACHED() << "Unexpected notification type: " << type; | 307 NOTREACHED() << "Unexpected notification type: " << type; |
310 } | 308 } |
311 } | 309 } |
312 | 310 |
313 } // namespace content | 311 } // namespace content |
OLD | NEW |