OLD | NEW |
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_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_member.h" | 10 #include "base/prefs/pref_member.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 107 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
108 &enable_referrers_, NULL, &force_google_safe_search_, | 108 &enable_referrers_, NULL, &force_google_safe_search_, |
109 profile_.GetTestingPrefService()); | 109 profile_.GetTestingPrefService()); |
110 } | 110 } |
111 | 111 |
112 protected: | 112 protected: |
113 scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate() { | 113 scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate() { |
114 scoped_ptr<ChromeNetworkDelegate> network_delegate( | 114 scoped_ptr<ChromeNetworkDelegate> network_delegate( |
115 new ChromeNetworkDelegate(forwarder(), &enable_referrers_)); | 115 new ChromeNetworkDelegate(forwarder(), &enable_referrers_)); |
116 network_delegate->set_force_google_safe_search(&force_google_safe_search_); | 116 network_delegate->set_force_google_safe_search(&force_google_safe_search_); |
117 return network_delegate.PassAs<net::NetworkDelegate>(); | 117 return network_delegate.Pass(); |
118 } | 118 } |
119 | 119 |
120 void SetSafeSearch(bool value) { | 120 void SetSafeSearch(bool value) { |
121 force_google_safe_search_.SetValue(value); | 121 force_google_safe_search_.SetValue(value); |
122 } | 122 } |
123 | 123 |
124 void SetDelegate(net::NetworkDelegate* delegate) { | 124 void SetDelegate(net::NetworkDelegate* delegate) { |
125 network_delegate_ = delegate; | 125 network_delegate_ = delegate; |
126 context_.set_network_delegate(network_delegate_); | 126 context_.set_network_delegate(network_delegate_); |
127 } | 127 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 cookie_settings_->SetCookieSetting( | 408 cookie_settings_->SetCookieSetting( |
409 ContentSettingsPattern::FromURL(kBlockedFirstPartySite), | 409 ContentSettingsPattern::FromURL(kBlockedFirstPartySite), |
410 ContentSettingsPattern::Wildcard(), | 410 ContentSettingsPattern::Wildcard(), |
411 CONTENT_SETTING_BLOCK); | 411 CONTENT_SETTING_BLOCK); |
412 // Privacy mode is disabled as kAllowedSite is still getting cookies | 412 // Privacy mode is disabled as kAllowedSite is still getting cookies |
413 EXPECT_FALSE(network_delegate_->CanEnablePrivacyMode(kAllowedSite, | 413 EXPECT_FALSE(network_delegate_->CanEnablePrivacyMode(kAllowedSite, |
414 kBlockedFirstPartySite)); | 414 kBlockedFirstPartySite)); |
415 } | 415 } |
416 | 416 |
OLD | NEW |