blob: 9d7c01cc9b943aa46cf4f17f59b330b395d4eb69 [file] [log] [blame]
// Copyright (c) 2011 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.
#import "base/mac/scoped_sending_event.h"
#include "base/check.h"
namespace base::mac {
ScopedSendingEvent::ScopedSendingEvent()
: app_(static_cast<NSObject<CrAppControlProtocol>*>(NSApp)) {
DCHECK([app_ conformsToProtocol:@protocol(CrAppControlProtocol)]);
handling_ = [app_ isHandlingSendEvent];
[app_ setHandlingSendEvent:YES];
}
ScopedSendingEvent::~ScopedSendingEvent() {
[app_ setHandlingSendEvent:handling_];
}
} // namespace base::mac