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

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 8364018: Enable privileged WebGL extensions for Chrome extensions. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « no previous file | chrome/browser/tab_contents/render_view_host_delegate_helper.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 Profile* profile = Profile::FromBrowserContext( 529 Profile* profile = Profile::FromBrowserContext(
530 render_view_host()->process()->browser_context()); 530 render_view_host()->process()->browser_context());
531 WebPreferences webkit_prefs = 531 WebPreferences webkit_prefs =
532 RenderViewHostDelegateHelper::GetWebkitPrefs(profile, 532 RenderViewHostDelegateHelper::GetWebkitPrefs(profile,
533 false); // is_web_ui 533 false); // is_web_ui
534 // Extensions are trusted so we override any user preferences for disabling 534 // Extensions are trusted so we override any user preferences for disabling
535 // javascript or images. 535 // javascript or images.
536 webkit_prefs.loads_images_automatically = true; 536 webkit_prefs.loads_images_automatically = true;
537 webkit_prefs.javascript_enabled = true; 537 webkit_prefs.javascript_enabled = true;
538 538
539 // Enable privileged WebGL extensions.
540 webkit_prefs.privileged_webgl_extensions_enabled = true;
541
539 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || 542 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP ||
540 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || 543 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG ||
541 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || 544 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
542 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) 545 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR)
543 webkit_prefs.allow_scripts_to_close_windows = true; 546 webkit_prefs.allow_scripts_to_close_windows = true;
544 547
545 // Disable anything that requires the GPU process for background pages. 548 // Disable anything that requires the GPU process for background pages.
546 // See http://crbug.com/64512 and http://crbug.com/64841. 549 // See http://crbug.com/64512 and http://crbug.com/64841.
547 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { 550 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
548 webkit_prefs.experimental_webgl_enabled = false; 551 webkit_prefs.experimental_webgl_enabled = false;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { 818 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) {
816 if (view_.get()) 819 if (view_.get())
817 view_->RenderViewCreated(); 820 view_->RenderViewCreated();
818 821
819 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || 822 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP ||
820 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) { 823 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) {
821 render_view_host->EnablePreferredSizeMode( 824 render_view_host->EnablePreferredSizeMode(
822 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); 825 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow);
823 } 826 }
824 } 827 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/render_view_host_delegate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698