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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 RenderViewHost* render_view_host, | 116 RenderViewHost* render_view_host, |
117 int instance_id, | 117 int instance_id, |
118 const std::string& src, | 118 const std::string& src, |
119 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { | 119 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
120 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); | 120 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); |
121 CHECK(guest); | 121 CHECK(guest); |
122 GURL url(src); | 122 GURL url(src); |
123 WebContentsImpl* guest_web_contents = | 123 WebContentsImpl* guest_web_contents = |
124 static_cast<WebContentsImpl*>(guest->GetWebContents()); | 124 static_cast<WebContentsImpl*>(guest->GetWebContents()); |
125 | 125 |
126 // We ignore loading empty urls in web_contents. | 126 // We do not load empty urls in web_contents. |
127 // If a guest sets empty src attribute after it has navigated to some | 127 // If a guest sets empty src attribute after it has navigated to some |
128 // non-empty page, the action is considered no-op. | 128 // non-empty page, the action is considered no-op. This empty src navigation |
129 // TODO(lazyboy): The js shim for browser-plugin might need to reflect empty | 129 // should never be sent to BrowserPluginEmbedder (browser process). |
130 // src ignoring in the shadow DOM element: http://crbug.com/149001. | 130 DCHECK(!src.empty()); |
131 if (!src.empty()) { | 131 if (!src.empty()) { |
| 132 // TODO(creis): Check the validity of the URL: http://crbug.com/139397. |
132 guest_web_contents->GetController().LoadURL(url, | 133 guest_web_contents->GetController().LoadURL(url, |
133 Referrer(), | 134 Referrer(), |
134 PAGE_TRANSITION_AUTO_SUBFRAME, | 135 PAGE_TRANSITION_AUTO_SUBFRAME, |
135 std::string()); | 136 std::string()); |
136 } | 137 } |
137 | 138 |
138 // Resize the guest if the resize parameter was set from the renderer. | 139 // Resize the guest if the resize parameter was set from the renderer. |
139 ResizeGuest(render_view_host, instance_id, resize_params); | 140 ResizeGuest(render_view_host, instance_id, resize_params); |
140 } | 141 } |
141 | 142 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 bool visible = *Details<bool>(details).ptr(); | 317 bool visible = *Details<bool>(details).ptr(); |
317 WebContentsVisibilityChanged(visible); | 318 WebContentsVisibilityChanged(visible); |
318 break; | 319 break; |
319 } | 320 } |
320 default: | 321 default: |
321 NOTREACHED() << "Unexpected notification type: " << type; | 322 NOTREACHED() << "Unexpected notification type: " << type; |
322 } | 323 } |
323 } | 324 } |
324 | 325 |
325 } // namespace content | 326 } // namespace content |
OLD | NEW |