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

Unified Diff: chrome/browser/policy/device_management_service.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO Created 8 years, 2 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
Index: chrome/browser/policy/device_management_service.cc
diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc
index 961b04fd214b4ec5429e8d9993ae584ad6b722c7..4f0d8b47ff35b2777e865d4a9f7c141226855eee 100644
--- a/chrome/browser/policy/device_management_service.cc
+++ b/chrome/browser/policy/device_management_service.cc
@@ -13,6 +13,7 @@
#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/net/basic_http_user_agent_settings.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_thread.h"
@@ -183,14 +184,14 @@ class DeviceManagementRequestContext : public net::URLRequestContext {
public:
explicit DeviceManagementRequestContext(net::URLRequestContext* base_context);
virtual ~DeviceManagementRequestContext();
-
private:
- // Overridden from net::URLRequestContext:
- virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE;
+ BasicHttpUserAgentSettings basic_http_user_agent_settings_;
};
DeviceManagementRequestContext::DeviceManagementRequestContext(
- net::URLRequestContext* base_context) {
+ net::URLRequestContext* base_context)
+ // Use sane Accept-Language and Accept-Charset values for our purposes.
+ : basic_http_user_agent_settings_("*", "*") {
// Share resolver, proxy service and ssl bits with the baseline context. This
// is important so we don't make redundant requests (e.g. when resolving proxy
// auto configuration).
@@ -207,20 +208,13 @@ DeviceManagementRequestContext::DeviceManagementRequestContext(
// No cookies, please.
set_cookie_store(new net::CookieMonster(NULL, NULL));
- // Initialize these to sane values for our purposes.
- set_accept_language("*");
- set_accept_charset("*");
+ set_http_user_agent_settings(&basic_http_user_agent_settings_);
}
DeviceManagementRequestContext::~DeviceManagementRequestContext() {
delete http_transaction_factory();
}
-const std::string& DeviceManagementRequestContext::GetUserAgent(
- const GURL& url) const {
- return content::GetUserAgent(url);
-}
-
// Request context holder.
class DeviceManagementRequestContextGetter
: public net::URLRequestContextGetter {

Powered by Google App Engine
This is Rietveld 408576698