| OLD | NEW |
| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 content::Source<Profile>(profile), | 169 content::Source<Profile>(profile), |
| 170 content::Details<BackgroundContents>(this)); | 170 content::Details<BackgroundContents>(this)); |
| 171 | 171 |
| 172 // Our RenderView went away, so we should go away also, so killing the process | 172 // Our RenderView went away, so we should go away also, so killing the process |
| 173 // via the TaskManager doesn't permanently leave a BackgroundContents hanging | 173 // via the TaskManager doesn't permanently leave a BackgroundContents hanging |
| 174 // around the system, blocking future instances from being created | 174 // around the system, blocking future instances from being created |
| 175 // (http://crbug.com/65189). | 175 // (http://crbug.com/65189). |
| 176 delete this; | 176 delete this; |
| 177 } | 177 } |
| 178 | 178 |
| 179 RendererPreferences BackgroundContents::GetRendererPrefs( | 179 content::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 content::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 WebPreferences prefs = | 188 WebPreferences prefs = |
| 189 RenderViewHostDelegateHelper::GetWebkitPrefs(render_view_host_); | 189 RenderViewHostDelegateHelper::GetWebkitPrefs(render_view_host_); |
| 190 | 190 |
| 191 // Disable all kinds of acceleration for background pages. | 191 // Disable all kinds of acceleration for background pages. |
| 192 // See http://crbug.com/96005 and http://crbug.com/96006 | 192 // See http://crbug.com/96005 and http://crbug.com/96006 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 BackgroundContents* | 246 BackgroundContents* |
| 247 BackgroundContents::GetBackgroundContentsByID(int render_process_id, | 247 BackgroundContents::GetBackgroundContentsByID(int render_process_id, |
| 248 int render_view_id) { | 248 int render_view_id) { |
| 249 RenderViewHost* render_view_host = | 249 RenderViewHost* render_view_host = |
| 250 RenderViewHost::FromID(render_process_id, render_view_id); | 250 RenderViewHost::FromID(render_process_id, render_view_id); |
| 251 if (!render_view_host) | 251 if (!render_view_host) |
| 252 return NULL; | 252 return NULL; |
| 253 | 253 |
| 254 return render_view_host->delegate()->GetAsBackgroundContents(); | 254 return render_view_host->delegate()->GetAsBackgroundContents(); |
| 255 } | 255 } |
| OLD | NEW |