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

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: Created 4 years, 10 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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 content::BrowserContext* context) { 1691 content::BrowserContext* context) {
1692 Profile* profile = Profile::FromBrowserContext(context); 1692 Profile* profile = Profile::FromBrowserContext(context);
1693 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 1693 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
1694 } 1694 }
1695 1695
1696 const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() { 1696 const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
1697 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 1697 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
1698 return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia(); 1698 return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
1699 } 1699 }
1700 1700
1701 bool ChromeContentBrowserClient::IsDataSaverEnabled(
1702 content::BrowserContext* browser_context) {
1703 Profile* profile = Profile::FromBrowserContext(browser_context);
1704 if (!profile)
1705 return false;
1706 PrefService* prefs = profile->GetPrefs();
1707 return prefs && prefs->GetBoolean(prefs::kDataSaverEnabled);
1708 }
1709
1701 bool ChromeContentBrowserClient::AllowAppCache( 1710 bool ChromeContentBrowserClient::AllowAppCache(
1702 const GURL& manifest_url, 1711 const GURL& manifest_url,
1703 const GURL& first_party, 1712 const GURL& first_party,
1704 content::ResourceContext* context) { 1713 content::ResourceContext* context) {
1705 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1714 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1706 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); 1715 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
1707 return io_data->GetCookieSettings()-> 1716 return io_data->GetCookieSettings()->
1708 IsSettingCookieAllowed(manifest_url, first_party); 1717 IsSettingCookieAllowed(manifest_url, first_party);
1709 } 1718 }
1710 1719
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 if (channel <= kMaxDisableEncryptionChannel) { 2837 if (channel <= kMaxDisableEncryptionChannel) {
2829 static const char* const kWebRtcDevSwitchNames[] = { 2838 static const char* const kWebRtcDevSwitchNames[] = {
2830 switches::kDisableWebRtcEncryption, 2839 switches::kDisableWebRtcEncryption,
2831 }; 2840 };
2832 to_command_line->CopySwitchesFrom(from_command_line, 2841 to_command_line->CopySwitchesFrom(from_command_line,
2833 kWebRtcDevSwitchNames, 2842 kWebRtcDevSwitchNames,
2834 arraysize(kWebRtcDevSwitchNames)); 2843 arraysize(kWebRtcDevSwitchNames));
2835 } 2844 }
2836 } 2845 }
2837 #endif // defined(ENABLE_WEBRTC) 2846 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698