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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 2049783002: Refactor OriginTrialPolicy to be an abstract interface in content/public/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-add-revoked-feature-list
Patch Set: Created 4 years, 6 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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 } 691 }
692 692
693 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() { 693 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() {
694 #if defined(ENABLE_EXTENSIONS) 694 #if defined(ENABLE_EXTENSIONS)
695 return extensions::IsIsolateExtensionsEnabled(); 695 return extensions::IsIsolateExtensionsEnabled();
696 #else 696 #else
697 return false; 697 return false;
698 #endif 698 #endif
699 } 699 }
700 700
701 base::StringPiece ChromeContentClient::GetOriginTrialPublicKey() const {
702 return origin_trial_key_manager_.GetPublicKey();
703 }
704
705 bool ChromeContentClient::IsOriginTrialFeatureDisabled(
706 base::StringPiece feature) const {
707 return origin_trial_key_manager_.IsFeatureDisabled(feature);
708 }
709
710 void ChromeContentClient::InitializeOriginTrialPolicy() { 701 void ChromeContentClient::InitializeOriginTrialPolicy() {
711 // Set the public key and disabled feature list for the origin trial key 702 // Set the public key and disabled feature list for the origin trial key
712 // manager, based on the command line flags which were passed to this process. 703 // manager, based on the command line flags which were passed to this process.
713 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 704 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
714 if (command_line->HasSwitch(switches::kOriginTrialPublicKey)) { 705 if (command_line->HasSwitch(switches::kOriginTrialPublicKey)) {
715 origin_trial_key_manager()->SetPublicKeyFromASCIIString( 706 origin_trial_policy_.SetPublicKeyFromASCIIString(
716 command_line->GetSwitchValueASCII(switches::kOriginTrialPublicKey)); 707 command_line->GetSwitchValueASCII(switches::kOriginTrialPublicKey));
717 } 708 }
718 if (command_line->HasSwitch(switches::kOriginTrialDisabledFeatures)) { 709 if (command_line->HasSwitch(switches::kOriginTrialDisabledFeatures)) {
719 origin_trial_key_manager()->SetDisabledFeatures( 710 origin_trial_policy_.SetDisabledFeatures(command_line->GetSwitchValueASCII(
720 command_line->GetSwitchValueASCII( 711 switches::kOriginTrialDisabledFeatures));
721 switches::kOriginTrialDisabledFeatures));
722 } 712 }
723 } 713 }
724 714
715 const content::OriginTrialPolicy* ChromeContentClient::GetOriginTrialPolicy()
716 const {
717 return &origin_trial_policy_;
718 }
719
725 #if defined(OS_ANDROID) 720 #if defined(OS_ANDROID)
726 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { 721 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() {
727 return new ChromeMediaClientAndroid(); 722 return new ChromeMediaClientAndroid();
728 } 723 }
729 #endif // OS_ANDROID 724 #endif // OS_ANDROID
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698