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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 11689004: Move PromoResourceService from Profile to BrowserProcessImpl/local_state(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android x 4 Created 8 years 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
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 3a72d680bd5ff1a8038264427e76c27f01049b84..2bc8b8ad83395dbc154d0f52aebb272da61a5b50 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -63,6 +63,7 @@
#include "chrome/browser/thumbnails/render_widget_snapshot_taker.h"
#include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/web_resource/promo_resource_service.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_notification_types.h"
@@ -790,6 +791,8 @@ void BrowserProcessImpl::PreCreateThreads() {
}
void BrowserProcessImpl::PreMainMessageLoopRun() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
#if defined(ENABLE_PLUGINS)
PluginService* plugin_service = PluginService::GetInstance();
plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance());
@@ -797,8 +800,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
// Register the internal Flash if available.
FilePath path;
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableInternalFlash) &&
+ if (!command_line.HasSwitch(switches::kDisableInternalFlash) &&
PathService::Get(chrome::FILE_FLASH_PLUGIN_EXISTING, &path)) {
plugin_service->AddExtraPluginPath(path);
}
@@ -825,7 +827,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
#endif // defined(ENABLE_PLUGINS)
- if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
+ if (local_state()->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
ApplyDefaultBrowserPolicy();
// Triggers initialization of the singleton instance on UI thread.
@@ -838,6 +840,12 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
}
#endif
+ if (!command_line.HasSwitch(switches::kDisableWebResources) &&
+ !promo_resource_service_) {
Bernhard Bauer 2012/12/31 11:51:52 When can it happen that |promo_resource_service_|
Dan Beam 2013/01/02 04:36:35 I am not sure, I was just following the plugins se
Bernhard Bauer 2013/01/02 10:57:44 It's probably unnecessary there as well. Feel free
jam 2013/01/02 15:59:00 I don't see where pluginservice is null checked? i
Dan Beam 2013/01/02 18:10:32 sorry, I meant L837: if (!plugins_resource_serv
jam 2013/01/02 18:14:55 that seems to be the only place that creates Plugi
+ promo_resource_service_ = new PromoResourceService(local_state());
+ promo_resource_service_->StartAfterDelay();
+ }
+
#if !defined(OS_ANDROID)
if (browser_defaults::bookmarks_enabled &&
BookmarkPromptController::IsEnabled())
@@ -910,7 +918,8 @@ void BrowserProcessImpl::CreateSafeBrowsingService() {
void BrowserProcessImpl::ApplyDisabledSchemesPolicy() {
std::set<std::string> schemes;
- const ListValue* scheme_list = local_state_->GetList(prefs::kDisabledSchemes);
+ const ListValue* scheme_list =
+ local_state()->GetList(prefs::kDisabledSchemes);
for (ListValue::const_iterator iter = scheme_list->begin();
iter != scheme_list->end(); ++iter) {
std::string scheme;
@@ -921,7 +930,7 @@ void BrowserProcessImpl::ApplyDisabledSchemesPolicy() {
}
void BrowserProcessImpl::ApplyDefaultBrowserPolicy() {
- if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) {
+ if (local_state()->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) {
scoped_refptr<ShellIntegration::DefaultWebClientWorker>
set_browser_worker = new ShellIntegration::DefaultBrowserWorker(NULL);
set_browser_worker->StartSetAsDefault();

Powered by Google App Engine
This is Rietveld 408576698