OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } else if (policy_str == "user-gesture-required-for-cross-origin") { | 546 } else if (policy_str == "user-gesture-required-for-cross-origin") { |
547 policy = AutoplayPolicy::Type::kUserGestureRequiredForCrossOrigin; | 547 policy = AutoplayPolicy::Type::kUserGestureRequiredForCrossOrigin; |
548 } else { | 548 } else { |
549 exception_state.ThrowDOMException( | 549 exception_state.ThrowDOMException( |
550 kSyntaxError, "The autoplay policy ('" + policy_str + ")' is invalid."); | 550 kSyntaxError, "The autoplay policy ('" + policy_str + ")' is invalid."); |
551 } | 551 } |
552 | 552 |
553 GetSettings()->SetAutoplayPolicy(policy); | 553 GetSettings()->SetAutoplayPolicy(policy); |
554 } | 554 } |
555 | 555 |
| 556 void InternalSettings::setDataSaverEnabled(bool enabled, |
| 557 ExceptionState& exception_state) { |
| 558 InternalSettingsGuardForSettings(); |
| 559 GetSettings()->SetDataSaverFlag(enabled ? WebDataSaverFlag::kEnabled |
| 560 : WebDataSaverFlag::kDisabled); |
| 561 } |
| 562 |
556 } // namespace blink | 563 } // namespace blink |
OLD | NEW |