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

Unified Diff: chrome/browser/tab_contents/render_view_host_delegate_helper.cc

Issue 6831016: Profile shouldn't own background page stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_host_delegate_helper.cc
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index c07acdd3bdb3a2aa3dc4b8e8dfdc4bccdf1aa28d..c6078c9ac2ff42e6fdf9662e52d5c93ed4112db1 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -10,6 +10,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/background_contents_service.h"
+#include "chrome/browser/background_contents_service_factory.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/gpu_data_manager.h"
@@ -64,8 +65,9 @@ RenderViewHostDelegateViewHelper::MaybeCreateBackgroundContents(
return NULL;
// Only allow a single background contents per app.
- if (!profile->GetBackgroundContentsService() ||
- profile->GetBackgroundContentsService()->GetAppBackgroundContents(
+ BackgroundContentsService* service =
+ BackgroundContentsServiceFactory::GetForProfile(profile);
+ if (!service || service->GetAppBackgroundContents(
ASCIIToUTF16(extension->id())))
return NULL;
@@ -77,8 +79,8 @@ RenderViewHostDelegateViewHelper::MaybeCreateBackgroundContents(
return NULL;
// Passed all the checks, so this should be created as a BackgroundContents.
- return profile->GetBackgroundContentsService()->CreateBackgroundContents(
- site, route_id, profile, frame_name, ASCIIToUTF16(extension->id()));
+ return service->CreateBackgroundContents(site, route_id, profile, frame_name,
+ ASCIIToUTF16(extension->id()));
}
TabContents* RenderViewHostDelegateViewHelper::CreateNewWindow(
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698