1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_MEDIA_UNIFIED_AUTOPLAY_CONFIG_H_ 6 #define CHROME_BROWSER_MEDIA_UNIFIED_AUTOPLAY_CONFIG_H_ 7 8 #include "base/macros.h" 9 10 class Profile; 11 12 namespace user_prefs { 13 class PrefRegistrySyncable; 14 } // namespace user_prefs 15 16 class UnifiedAutoplayConfig { 17 public: 18 // Register profile prefs in the pref registry. 19 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable*); 20 21 // Checks whether autoplay should be blocked by user preference. This will be 22 // true if the block autoplay pref is true and if the default sound content 23 // setting value is not block. 24 static bool ShouldBlockAutoplay(Profile*); 25 26 // Checks whether the block autoplay toggle button should be enabled. If it is 27 // false it will still be visible but will be disabled. 28 static bool IsBlockAutoplayUserModifiable(Profile*); 29 30 private: 31 DISALLOW_IMPLICIT_CONSTRUCTORS(UnifiedAutoplayConfig); 32 }; 33 34 #endif // CHROME_BROWSER_MEDIA_UNIFIED_AUTOPLAY_CONFIG_H_ 35