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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 99433004: Add a header when fetching pages under the DMServer URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit tests and fixed up from weekend component refactoring. Created 7 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/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index e50779ce5fb9da6df15836c34fc522493e7cec96..6a91d88909e015e64a647522d6f85f84e278ca0b 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -45,6 +45,10 @@
#include "chrome/browser/net/load_time_stats.h"
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/browser/net/resource_prefetch_predictor_observer.h"
+#include "chrome/browser/policy/cloud/policy_header_service.h"
+#include "chrome/browser/policy/cloud/policy_header_service_factory.h"
+#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
+#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
#include "chrome/browser/policy/url_blacklist_manager.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
@@ -55,6 +59,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/policy/core/browser/policy_header_io_helper.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/host_zoom_map.h"
@@ -470,6 +475,16 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
// in particular when this ProfileIOData isn't |initialized_| during deletion.
#if defined(ENABLE_CONFIGURATION_POLICY)
url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service));
+
+ if (!is_incognito()) {
+ // Add policy headers for non-incognito requests.
+ policy::PolicyHeaderService* policy_header_service =
+ policy::PolicyHeaderServiceFactory::GetForBrowserContext(profile);
+ if (policy_header_service) {
+ policy_header_helper_ = policy_header_service->CreatePolicyHeaderIOHelper(
+ io_message_loop_proxy).Pass();
+ }
+ }
#endif
initialized_on_UI_thread_ = true;

Powered by Google App Engine
This is Rietveld 408576698