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

Side by Side Diff: media/base/media_util.cc

Issue 2846623003: Make autoplay policies no longer platform dependant. (Closed)
Patch Set: Created 3 years, 7 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
« media/base/media_util.h ('K') | « media/base/media_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "media/base/media_util.h" 5 #include "media/base/media_util.h"
6 6
7 #include "base/command_line.h"
8 #include "media/base/media_switches.h"
9
7 namespace media { 10 namespace media {
8 11
9 std::vector<uint8_t> EmptyExtraData() { 12 std::vector<uint8_t> EmptyExtraData() {
10 return std::vector<uint8_t>(); 13 return std::vector<uint8_t>();
11 } 14 }
12 15
13 EncryptionScheme Unencrypted() { 16 EncryptionScheme Unencrypted() {
14 return EncryptionScheme(); 17 return EncryptionScheme();
15 } 18 }
16 19
17 EncryptionScheme AesCtrEncryptionScheme() { 20 EncryptionScheme AesCtrEncryptionScheme() {
18 return EncryptionScheme(EncryptionScheme::CIPHER_MODE_AES_CTR, 21 return EncryptionScheme(EncryptionScheme::CIPHER_MODE_AES_CTR,
19 EncryptionScheme::Pattern()); 22 EncryptionScheme::Pattern());
20 } 23 }
21 24
25 std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) {
26 if (command_line.HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests))
27 return switches::autoplay::kNoUserGestureRequiredPolicy;
28
29 // Return the default policy if none is specified in the command line.
30 if (!command_line.HasSwitch(switches::kAutoplayPolicy)) {
31 #if defined(OS_ANDROID)
32 return switches::autoplay::kUserGestureRequiredPolicy;
33 #else
34 return switches::autoplay::kNoUserGestureRequiredPolicy;
35 #endif
36 }
37
38 return command_line.GetSwitchValueASCII(switches::kAutoplayPolicy);
39 }
40
22 } // namespace media 41 } // namespace media
OLDNEW
« media/base/media_util.h ('K') | « media/base/media_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698