| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 if (resignationObserver_) { | 196 if (resignationObserver_) { |
| 197 [[NSNotificationCenter defaultCenter] | 197 [[NSNotificationCenter defaultCenter] |
| 198 removeObserver:resignationObserver_ | 198 removeObserver:resignationObserver_ |
| 199 name:NSWindowDidResignKeyNotification | 199 name:NSWindowDidResignKeyNotification |
| 200 object:nil]; | 200 object:nil]; |
| 201 resignationObserver_ = nil; | 201 resignationObserver_ = nil; |
| 202 } | 202 } |
| 203 | 203 |
| 204 tabStripObserverBridge_.reset(); | 204 tabStripObserverBridge_.reset(); |
| 205 | |
| 206 NSWindow* window = [self window]; | |
| 207 [[window parentWindow] removeChildWindow:window]; | |
| 208 } | 205 } |
| 209 | 206 |
| 210 - (void)windowWillClose:(NSNotification*)notification { | 207 - (void)windowWillClose:(NSNotification*)notification { |
| 211 [self closeCleanup]; | 208 [self closeCleanup]; |
| 212 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 209 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 213 [self autorelease]; | 210 [self autorelease]; |
| 214 } | 211 } |
| 215 | 212 |
| 216 // We want this to be a child of a browser window. addChildWindow: | 213 // We want this to be a child of a browser window. addChildWindow: |
| 217 // (called from this function) will bring the window on-screen; | 214 // (called from this function) will bring the window on-screen; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 378 |
| 382 - (void)activateTabWithContents:(content::WebContents*)newContents | 379 - (void)activateTabWithContents:(content::WebContents*)newContents |
| 383 previousContents:(content::WebContents*)oldContents | 380 previousContents:(content::WebContents*)oldContents |
| 384 atIndex:(NSInteger)index | 381 atIndex:(NSInteger)index |
| 385 reason:(int)reason { | 382 reason:(int)reason { |
| 386 // The user switched tabs; close. | 383 // The user switched tabs; close. |
| 387 [self close]; | 384 [self close]; |
| 388 } | 385 } |
| 389 | 386 |
| 390 @end // BaseBubbleController | 387 @end // BaseBubbleController |
| OLD | NEW |