Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / extensions / extension_view_host_mac.mm
blob5db8071e9dc10ad818f0eb1dd006cf82e829cc04
1 // Copyright 2013 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.
5 #include "chrome/browser/extensions/extension_view_host_mac.h"
7 #import "base/mac/foundation_util.h"
8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
9 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
10 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
12 namespace extensions {
14 ExtensionViewHostMac::~ExtensionViewHostMac() {
15   // If there is a popup open for this host's extension, close it.
16   ExtensionPopupController* popup = [ExtensionPopupController popup];
17   InfoBubbleWindow* window =
18       base::mac::ObjCCast<InfoBubbleWindow>([popup window]);
19   if ([window isVisible] && [popup extensionViewHost] == this) {
20     [window setAllowedAnimations:info_bubble::kAnimateNone];
21     [popup close];
22   }
25 }  // namespace extensions