Home | History | Annotate | Download | only in extensions
      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.
      4 
      5 #include "chrome/browser/extensions/extension_view_host_mac.h"
      6 
      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"
     11 
     12 namespace extensions {
     13 
     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   }
     23 }
     24 
     25 }  // namespace extensions
     26