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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 206923002: Adds plumbing to pass WebUI mojo::Handle from browser to renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO and merge to trunk Created 6 years, 9 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
« no previous file with comments | « content/renderer/mojo/mojo_render_process_observer.cc ('k') | content/renderer/web_ui_mojo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 #if defined(ENABLE_PLUGINS) 231 #if defined(ENABLE_PLUGINS)
232 #include "content/renderer/npapi/webplugin_delegate_proxy.h" 232 #include "content/renderer/npapi/webplugin_delegate_proxy.h"
233 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 233 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
234 #include "content/renderer/pepper/pepper_plugin_registry.h" 234 #include "content/renderer/pepper/pepper_plugin_registry.h"
235 #endif 235 #endif
236 236
237 #if defined(ENABLE_WEBRTC) 237 #if defined(ENABLE_WEBRTC)
238 #include "content/renderer/media/rtc_peer_connection_handler.h" 238 #include "content/renderer/media/rtc_peer_connection_handler.h"
239 #endif 239 #endif
240 240
241 #if defined(USE_MOJO)
242 #include "content/renderer/web_ui_mojo.h"
243 #endif
244
241 using blink::WebAXObject; 245 using blink::WebAXObject;
242 using blink::WebApplicationCacheHost; 246 using blink::WebApplicationCacheHost;
243 using blink::WebApplicationCacheHostClient; 247 using blink::WebApplicationCacheHostClient;
244 using blink::WebCString; 248 using blink::WebCString;
245 using blink::WebColor; 249 using blink::WebColor;
246 using blink::WebColorName; 250 using blink::WebColorName;
247 using blink::WebConsoleMessage; 251 using blink::WebConsoleMessage;
248 using blink::WebData; 252 using blink::WebData;
249 using blink::WebDataSource; 253 using blink::WebDataSource;
250 using blink::WebDocument; 254 using blink::WebDocument;
(...skipping 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 if (!params.target_origin.empty()) { 3518 if (!params.target_origin.empty()) {
3515 target_origin = 3519 target_origin =
3516 WebSecurityOrigin::createFromString(WebString(params.target_origin)); 3520 WebSecurityOrigin::createFromString(WebString(params.target_origin));
3517 } 3521 }
3518 frame->dispatchMessageEventWithOriginCheck(target_origin, msg_event); 3522 frame->dispatchMessageEventWithOriginCheck(target_origin, msg_event);
3519 } 3523 }
3520 3524
3521 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { 3525 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) {
3522 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && 3526 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) &&
3523 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { 3527 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) {
3528 // WebUIExtensionData deletes itself when we're destroyed.
3524 new WebUIExtensionData(this); 3529 new WebUIExtensionData(this);
3530 #if defined(USE_MOJO)
3531 // WebUIMojo deletes itself when we're destroyed.
3532 new WebUIMojo(this);
3533 #endif
3525 } 3534 }
3526 3535
3527 enabled_bindings_ |= enabled_bindings_flags; 3536 enabled_bindings_ |= enabled_bindings_flags;
3528 3537
3529 // Keep track of the total bindings accumulated in this process. 3538 // Keep track of the total bindings accumulated in this process.
3530 RenderProcess::current()->AddBindings(enabled_bindings_flags); 3539 RenderProcess::current()->AddBindings(enabled_bindings_flags);
3531 } 3540 }
3532 3541
3533 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, 3542 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data,
3534 const gfx::Point& client_point, 3543 const gfx::Point& client_point,
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
4960 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size()); 4969 std::vector<gfx::Size> sizes(icon_urls[i].sizes().size());
4961 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4970 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4962 if (!url.isEmpty()) 4971 if (!url.isEmpty())
4963 urls.push_back( 4972 urls.push_back(
4964 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4973 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4965 } 4974 }
4966 SendUpdateFaviconURL(urls); 4975 SendUpdateFaviconURL(urls);
4967 } 4976 }
4968 4977
4969 } // namespace content 4978 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mojo/mojo_render_process_observer.cc ('k') | content/renderer/web_ui_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698