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

Side by Side Diff: chrome/browser/net/chrome_http_user_agent_settings.cc

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/net/chrome_http_user_agent_settings.h" 5 #include "chrome/browser/net/chrome_http_user_agent_settings.h"
6 6
7 #include "chrome/browser/prefs/pref_service.h" 7 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/common/pref_names.h" 8 #include "chrome/common/pref_names.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/common/content_client.h" 10 #include "content/public/common/content_client.h"
11 #include "net/http/http_util.h" 11 #include "net/http/http_util.h"
12 12
13 ChromeHttpUserAgentSettings::ChromeHttpUserAgentSettings(PrefService* prefs) { 13 ChromeHttpUserAgentSettings::ChromeHttpUserAgentSettings(PrefService* prefs) {
14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
15 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs, NULL); 15 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs);
16 pref_accept_charset_.Init(prefs::kDefaultCharset, prefs, NULL); 16 pref_accept_charset_.Init(prefs::kDefaultCharset, prefs);
17 last_pref_accept_language_ = *pref_accept_language_; 17 last_pref_accept_language_ = *pref_accept_language_;
18 last_http_accept_language_ = 18 last_http_accept_language_ =
19 net::HttpUtil::GenerateAcceptLanguageHeader(last_pref_accept_language_); 19 net::HttpUtil::GenerateAcceptLanguageHeader(last_pref_accept_language_);
20 last_pref_accept_charset_ = *pref_accept_charset_; 20 last_pref_accept_charset_ = *pref_accept_charset_;
21 last_http_accept_charset_ = 21 last_http_accept_charset_ =
22 net::HttpUtil::GenerateAcceptCharsetHeader(last_pref_accept_charset_); 22 net::HttpUtil::GenerateAcceptCharsetHeader(last_pref_accept_charset_);
23 pref_accept_language_.MoveToThread( 23 pref_accept_language_.MoveToThread(
24 content::BrowserThread::GetMessageLoopProxyForThread( 24 content::BrowserThread::GetMessageLoopProxyForThread(
25 content::BrowserThread::IO)); 25 content::BrowserThread::IO));
26 pref_accept_charset_.MoveToThread( 26 pref_accept_charset_.MoveToThread(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 last_pref_accept_charset_ = new_pref_accept_charset; 58 last_pref_accept_charset_ = new_pref_accept_charset;
59 } 59 }
60 return last_http_accept_charset_; 60 return last_http_accept_charset_;
61 } 61 }
62 62
63 std::string ChromeHttpUserAgentSettings::GetUserAgent(const GURL& url) const { 63 std::string ChromeHttpUserAgentSettings::GetUserAgent(const GURL& url) const {
64 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 64 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
65 return content::GetUserAgent(url); 65 return content::GetUserAgent(url);
66 } 66 }
67 67
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs_unittest.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698