| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 #include "config.h" | |
| 6 #include "core/dom/ScopedWindowFocusAllowedIndicator.h" | |
| 7 | |
| 8 #include "core/dom/ExecutionContext.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 ScopedWindowFocusAllowedIndicator::ScopedWindowFocusAllowedIndicator( | |
| 13 ExecutionContext* context) | |
| 14 : ContextLifecycleObserver(context) | |
| 15 { | |
| 16 if (executionContext()) | |
| 17 executionContext()->allowWindowFocus(); | |
| 18 } | |
| 19 | |
| 20 ScopedWindowFocusAllowedIndicator::~ScopedWindowFocusAllowedIndicator() | |
| 21 { | |
| 22 if (executionContext()) | |
| 23 executionContext()->consumeWindowFocus(); | |
| 24 } | |
| 25 | |
| 26 } // namespace blink | |
| OLD | NEW |