Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 11111020: <browser>: Always read <browser>.src attribute from <object>.src. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ignore empty src_ altogether for SetSrcAttribute. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
Fady Samuel 2012/10/12 20:45:05 and should never be sent to the browser process.
lazyboy 2012/10/12 20:51:39 Done.
128 // TODO(lazyboy): The js shim for browser-plugin might need to reflect empty 128 CHECK(!src.empty());
129 // src ignoring in the shadow DOM element: http://crbug.com/149001. 129 guest_web_contents->GetController().LoadURL(url,
130 if (!src.empty()) { 130 Referrer(),
131 guest_web_contents->GetController().LoadURL(url, 131 PAGE_TRANSITION_AUTO_SUBFRAME,
132 Referrer(), 132 std::string());
133 PAGE_TRANSITION_AUTO_SUBFRAME,
134 std::string());
135 }
136 133
137 // Resize the guest if the resize parameter was set from the renderer. 134 // Resize the guest if the resize parameter was set from the renderer.
138 ResizeGuest(render_view_host, instance_id, resize_params); 135 ResizeGuest(render_view_host, instance_id, resize_params);
139 } 136 }
140 137
141 void BrowserPluginEmbedder::UpdateRectACK(int instance_id, 138 void BrowserPluginEmbedder::UpdateRectACK(int instance_id,
142 int message_id, 139 int message_id,
143 const gfx::Size& size) { 140 const gfx::Size& size) {
144 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id); 141 BrowserPluginGuest* guest = GetGuestByInstanceID(instance_id);
145 if (guest) 142 if (guest)
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 bool visible = *Details<bool>(details).ptr(); 301 bool visible = *Details<bool>(details).ptr();
305 WebContentsVisibilityChanged(visible); 302 WebContentsVisibilityChanged(visible);
306 break; 303 break;
307 } 304 }
308 default: 305 default:
309 NOTREACHED() << "Unexpected notification type: " << type; 306 NOTREACHED() << "Unexpected notification type: " << type;
310 } 307 }
311 } 308 }
312 309
313 } // namespace content 310 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698