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

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

Issue 163683004: Implement WebUI extension via gin instead of v8::Extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/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 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after
3287 } 3287 }
3288 3288
3289 void RenderViewImpl::didClearWindowObject(WebFrame* frame, int world_id) { 3289 void RenderViewImpl::didClearWindowObject(WebFrame* frame, int world_id) {
3290 FOR_EACH_OBSERVER(RenderViewObserver, observers_, 3290 FOR_EACH_OBSERVER(RenderViewObserver, observers_,
3291 DidClearWindowObject(frame, world_id)); 3291 DidClearWindowObject(frame, world_id));
3292 3292
3293 // Only install controllers into the main world. 3293 // Only install controllers into the main world.
3294 if (world_id) 3294 if (world_id)
3295 return; 3295 return;
3296 3296
3297 if (enabled_bindings_& BINDINGS_POLICY_WEB_UI)
3298 WebUIExtension::Install(frame);
3299
3297 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) 3300 if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION)
3298 DomAutomationController::Install(this, frame); 3301 DomAutomationController::Install(this, frame);
3299 3302
3300 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) 3303 if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION)
3301 StatsCollectionController::Install(frame); 3304 StatsCollectionController::Install(frame);
3302 3305
3303 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 3306 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
3304 3307
3305 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking)) 3308 if (command_line.HasSwitch(switches::kEnableSkiaBenchmarking))
3306 SkiaBenchmarking::Install(frame); 3309 SkiaBenchmarking::Install(frame);
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
4326 frame->document().insertUserStyleSheet( 4329 frame->document().insertUserStyleSheet(
4327 WebString::fromUTF8(css), 4330 WebString::fromUTF8(css),
4328 WebDocument::UserStyleAuthorLevel); 4331 WebDocument::UserStyleAuthorLevel);
4329 } 4332 }
4330 4333
4331 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) { 4334 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) {
4332 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) && 4335 if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) &&
4333 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) { 4336 !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) {
4334 // WebUI uses <dialog> which is not yet enabled by default in Chrome. 4337 // WebUI uses <dialog> which is not yet enabled by default in Chrome.
4335 WebRuntimeFeatures::enableDialogElement(true); 4338 WebRuntimeFeatures::enableDialogElement(true);
4336
4337 RenderThread::Get()->RegisterExtension(WebUIExtension::Get());
4338 new WebUIExtensionData(this); 4339 new WebUIExtensionData(this);
4339 } 4340 }
4340 4341
4341 enabled_bindings_ |= enabled_bindings_flags; 4342 enabled_bindings_ |= enabled_bindings_flags;
4342 4343
4343 // Keep track of the total bindings accumulated in this process. 4344 // Keep track of the total bindings accumulated in this process.
4344 RenderProcess::current()->AddBindings(enabled_bindings_flags); 4345 RenderProcess::current()->AddBindings(enabled_bindings_flags);
4345 } 4346 }
4346 4347
4347 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data, 4348 void RenderViewImpl::OnDragTargetDragEnter(const DropData& drop_data,
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
5783 for (size_t i = 0; i < icon_urls.size(); i++) { 5784 for (size_t i = 0; i < icon_urls.size(); i++) {
5784 WebURL url = icon_urls[i].iconURL(); 5785 WebURL url = icon_urls[i].iconURL();
5785 if (!url.isEmpty()) 5786 if (!url.isEmpty())
5786 urls.push_back(FaviconURL(url, 5787 urls.push_back(FaviconURL(url,
5787 ToFaviconType(icon_urls[i].iconType()))); 5788 ToFaviconType(icon_urls[i].iconType())));
5788 } 5789 }
5789 SendUpdateFaviconURL(urls); 5790 SendUpdateFaviconURL(urls);
5790 } 5791 }
5791 5792
5792 } // namespace content 5793 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/web_ui_extension.h » ('j') | content/renderer/web_ui_extension.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698