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

Side by Side Diff: chrome/browser/tab_contents/background_contents.cc

Issue 8198012: Merge 100404 - apps/extensions: Disable all kinds of acceleration for background pages. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/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 | no next file » | 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/tab_contents/background_contents.h" 5 #include "chrome/browser/tab_contents/background_contents.h"
6 6
7 #include "chrome/browser/background/background_contents_service.h" 7 #include "chrome/browser/background/background_contents_service.h"
8 #include "chrome/browser/extensions/extension_message_service.h" 8 #include "chrome/browser/extensions/extension_message_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/renderer_preferences_util.h" 10 #include "chrome/browser/renderer_preferences_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 RendererPreferences preferences; 181 RendererPreferences preferences;
182 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); 182 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile);
183 return preferences; 183 return preferences;
184 } 184 }
185 185
186 WebPreferences BackgroundContents::GetWebkitPrefs() { 186 WebPreferences BackgroundContents::GetWebkitPrefs() {
187 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for 187 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for
188 // apps. 188 // apps.
189 Profile* profile = Profile::FromBrowserContext( 189 Profile* profile = Profile::FromBrowserContext(
190 render_view_host_->process()->browser_context()); 190 render_view_host_->process()->browser_context());
191 return RenderViewHostDelegateHelper::GetWebkitPrefs(profile, 191 WebPreferences prefs = RenderViewHostDelegateHelper::GetWebkitPrefs(profile,
192 false); // is_web_ui 192 false);
193 // Disable all kinds of acceleration for background pages.
194 // See http://crbug.com/96005 and http://crbug.com/96006
195 prefs.force_compositing_mode = false;
196 prefs.accelerated_compositing_enabled = false;
197 prefs.accelerated_2d_canvas_enabled = false;
198 prefs.accelerated_video_enabled = false;
199 prefs.accelerated_drawing_enabled = false;
200 prefs.accelerated_plugins_enabled = false;
201
202 return prefs;
193 } 203 }
194 204
195 void BackgroundContents::CreateNewWindow( 205 void BackgroundContents::CreateNewWindow(
196 int route_id, 206 int route_id,
197 const ViewHostMsg_CreateWindow_Params& params) { 207 const ViewHostMsg_CreateWindow_Params& params) {
198 Profile* profile = Profile::FromBrowserContext( 208 Profile* profile = Profile::FromBrowserContext(
199 render_view_host_->process()->browser_context()); 209 render_view_host_->process()->browser_context());
200 delegate_view_helper_.CreateNewWindow( 210 delegate_view_helper_.CreateNewWindow(
201 route_id, 211 route_id,
202 profile, 212 profile,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 BackgroundContents* 248 BackgroundContents*
239 BackgroundContents::GetBackgroundContentsByID(int render_process_id, 249 BackgroundContents::GetBackgroundContentsByID(int render_process_id,
240 int render_view_id) { 250 int render_view_id) {
241 RenderViewHost* render_view_host = 251 RenderViewHost* render_view_host =
242 RenderViewHost::FromID(render_process_id, render_view_id); 252 RenderViewHost::FromID(render_process_id, render_view_id);
243 if (!render_view_host) 253 if (!render_view_host)
244 return NULL; 254 return NULL;
245 255
246 return render_view_host->delegate()->GetAsBackgroundContents(); 256 return render_view_host->delegate()->GetAsBackgroundContents();
247 } 257 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698