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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1708583003: Pass data saver pref value into embedded worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 4 years, 9 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 unified diff | Download patch
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 content::BrowserContext* context) { 1718 content::BrowserContext* context) {
1719 Profile* profile = Profile::FromBrowserContext(context); 1719 Profile* profile = Profile::FromBrowserContext(context);
1720 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 1720 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
1721 } 1721 }
1722 1722
1723 const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() { 1723 const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
1724 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 1724 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
1725 return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia(); 1725 return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
1726 } 1726 }
1727 1727
1728 bool ChromeContentBrowserClient::IsDataSaverEnabled(
1729 content::BrowserContext* browser_context) {
1730 Profile* profile = Profile::FromBrowserContext(browser_context);
1731 if (!profile)
1732 return false;
1733 PrefService* prefs = profile->GetPrefs();
1734 return prefs && prefs->GetBoolean(prefs::kDataSaverEnabled);
1735 }
1736
1728 bool ChromeContentBrowserClient::AllowAppCache( 1737 bool ChromeContentBrowserClient::AllowAppCache(
1729 const GURL& manifest_url, 1738 const GURL& manifest_url,
1730 const GURL& first_party, 1739 const GURL& first_party,
1731 content::ResourceContext* context) { 1740 content::ResourceContext* context) {
1732 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1741 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1733 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); 1742 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
1734 return io_data->GetCookieSettings()-> 1743 return io_data->GetCookieSettings()->
1735 IsSettingCookieAllowed(manifest_url, first_party); 1744 IsSettingCookieAllowed(manifest_url, first_party);
1736 } 1745 }
1737 1746
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 if (channel <= kMaxDisableEncryptionChannel) { 2952 if (channel <= kMaxDisableEncryptionChannel) {
2944 static const char* const kWebRtcDevSwitchNames[] = { 2953 static const char* const kWebRtcDevSwitchNames[] = {
2945 switches::kDisableWebRtcEncryption, 2954 switches::kDisableWebRtcEncryption,
2946 }; 2955 };
2947 to_command_line->CopySwitchesFrom(from_command_line, 2956 to_command_line->CopySwitchesFrom(from_command_line,
2948 kWebRtcDevSwitchNames, 2957 kWebRtcDevSwitchNames,
2949 arraysize(kWebRtcDevSwitchNames)); 2958 arraysize(kWebRtcDevSwitchNames));
2950 } 2959 }
2951 } 2960 }
2952 #endif // defined(ENABLE_WEBRTC) 2961 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/chrome_content_browser_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698