summaryrefslogtreecommitdiffstats
path: root/ui/events/platform/scoped_event_dispatcher.cc
blob: b0941ab851394191a2374af1b8f79ea2326a8723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/events/platform/scoped_event_dispatcher.h"

#include "ui/events/platform/platform_event_source.h"

namespace ui {

ScopedEventDispatcher::ScopedEventDispatcher(
    PlatformEventDispatcher** scoped_dispatcher,
    PlatformEventDispatcher* new_dispatcher)
    : original_(*scoped_dispatcher),
      restore_(scoped_dispatcher, new_dispatcher) {}

ScopedEventDispatcher::~ScopedEventDispatcher() {
  PlatformEventSource::GetInstance()->OnOverriddenDispatcherRestored();
}

}  // namespace ui