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

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

Issue 8403024: Set extension-related webkit preferences in a common location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove is_web_ui param Created 9 years, 1 month 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) 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 RendererPreferences BackgroundContents::GetRendererPrefs( 179 RendererPreferences BackgroundContents::GetRendererPrefs(
180 content::BrowserContext* browser_context) const { 180 content::BrowserContext* browser_context) const {
181 Profile* profile = Profile::FromBrowserContext(browser_context); 181 Profile* profile = Profile::FromBrowserContext(browser_context);
182 RendererPreferences preferences; 182 RendererPreferences preferences;
183 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); 183 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile);
184 return preferences; 184 return preferences;
185 } 185 }
186 186
187 WebPreferences BackgroundContents::GetWebkitPrefs() { 187 WebPreferences BackgroundContents::GetWebkitPrefs() {
188 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for 188 WebPreferences prefs =
189 // apps. 189 RenderViewHostDelegateHelper::GetWebkitPrefs(render_view_host_);
190 Profile* profile = Profile::FromBrowserContext( 190
191 render_view_host_->process()->browser_context());
192 WebPreferences prefs = RenderViewHostDelegateHelper::GetWebkitPrefs(profile,
193 false);
194 // Disable all kinds of acceleration for background pages. 191 // Disable all kinds of acceleration for background pages.
195 // See http://crbug.com/96005 and http://crbug.com/96006 192 // See http://crbug.com/96005 and http://crbug.com/96006
196 prefs.force_compositing_mode = false; 193 prefs.force_compositing_mode = false;
197 prefs.accelerated_compositing_enabled = false; 194 prefs.accelerated_compositing_enabled = false;
198 prefs.accelerated_2d_canvas_enabled = false; 195 prefs.accelerated_2d_canvas_enabled = false;
199 prefs.accelerated_video_enabled = false; 196 prefs.accelerated_video_enabled = false;
200 prefs.accelerated_drawing_enabled = false; 197 prefs.accelerated_drawing_enabled = false;
201 prefs.accelerated_plugins_enabled = false; 198 prefs.accelerated_plugins_enabled = false;
202 199
203 return prefs; 200 return prefs;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 BackgroundContents* 246 BackgroundContents*
250 BackgroundContents::GetBackgroundContentsByID(int render_process_id, 247 BackgroundContents::GetBackgroundContentsByID(int render_process_id,
251 int render_view_id) { 248 int render_view_id) {
252 RenderViewHost* render_view_host = 249 RenderViewHost* render_view_host =
253 RenderViewHost::FromID(render_process_id, render_view_id); 250 RenderViewHost::FromID(render_process_id, render_view_id);
254 if (!render_view_host) 251 if (!render_view_host)
255 return NULL; 252 return NULL;
256 253
257 return render_view_host->delegate()->GetAsBackgroundContents(); 254 return render_view_host->delegate()->GetAsBackgroundContents();
258 } 255 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon_host.cc ('k') | chrome/browser/tab_contents/render_view_host_delegate_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698