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

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

Issue 2502743003: Allow getting both reading/setting cookie settings at one time (Closed)
Patch Set: rdevlin review Created 4 years, 1 month 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/net/chrome_network_delegate.h" 5 #include "chrome/browser/net/chrome_network_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 543 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
544 } 544 }
545 545
546 bool ChromeNetworkDelegate::OnCanEnablePrivacyMode( 546 bool ChromeNetworkDelegate::OnCanEnablePrivacyMode(
547 const GURL& url, 547 const GURL& url,
548 const GURL& first_party_for_cookies) const { 548 const GURL& first_party_for_cookies) const {
549 // nullptr during tests, or when we're running in the system context. 549 // nullptr during tests, or when we're running in the system context.
550 if (!cookie_settings_.get()) 550 if (!cookie_settings_.get())
551 return false; 551 return false;
552 552
553 bool reading_cookie_allowed = cookie_settings_->IsReadingCookieAllowed( 553 bool reading_cookie_allowed = false;
554 url, first_party_for_cookies); 554 bool setting_cookie_allowed = false;
555 bool setting_cookie_allowed = cookie_settings_->IsSettingCookieAllowed( 555 cookie_settings_->GetReadingAndSettingCookieAllowed(
556 url, first_party_for_cookies); 556 url, first_party_for_cookies, &reading_cookie_allowed,
557 &setting_cookie_allowed);
557 bool privacy_mode = !(reading_cookie_allowed && setting_cookie_allowed); 558 bool privacy_mode = !(reading_cookie_allowed && setting_cookie_allowed);
558 return privacy_mode; 559 return privacy_mode;
559 } 560 }
560 561
561 bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { 562 bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
562 return experimental_web_platform_features_enabled_; 563 return experimental_web_platform_features_enabled_;
563 } 564 }
564 565
565 bool ChromeNetworkDelegate::OnAreStrictSecureCookiesEnabled() const { 566 bool ChromeNetworkDelegate::OnAreStrictSecureCookiesEnabled() const {
566 const std::string enforce_strict_secure_group = 567 const std::string enforce_strict_secure_group =
(...skipping 17 matching lines...) Expand all
584 if (!data_use_aggregator_) 585 if (!data_use_aggregator_)
585 return; 586 return;
586 587
587 if (is_data_usage_off_the_record_) { 588 if (is_data_usage_off_the_record_) {
588 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); 589 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes);
589 return; 590 return;
590 } 591 }
591 592
592 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); 593 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes);
593 } 594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698