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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 TabStripController* tabStripController = [bwc tabStripController]; | 109 TabStripController* tabStripController = [bwc tabStripController]; |
110 TabStripModel* tabStripModel = [tabStripController tabStripModel]; | 110 TabStripModel* tabStripModel = [tabStripController tabStripModel]; |
111 tabStripObserverBridge_.reset(new TabStripModelObserverBridge(tabStripModel, | 111 tabStripObserverBridge_.reset(new TabStripModelObserverBridge(tabStripModel, |
112 self)); | 112 self)); |
113 } | 113 } |
114 | 114 |
115 [bubble_ setArrowLocation:info_bubble::kTopRight]; | 115 [bubble_ setArrowLocation:info_bubble::kTopRight]; |
116 } | 116 } |
117 | 117 |
118 - (void)dealloc { | 118 - (void)dealloc { |
119 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 119 [self unregisterFromNotifications]; |
120 [super dealloc]; | 120 [super dealloc]; |
121 } | 121 } |
122 | 122 |
123 - (void)registerForNotifications { | 123 - (void)registerForNotifications { |
124 // No window to register notifications for. | 124 // No window to register notifications for. |
125 if (!parentWindow_) | 125 if (!parentWindow_) |
126 return; | 126 return; |
127 | 127 |
128 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 128 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
129 // Watch to see if the parent window closes, and if so, close this one. | 129 // Watch to see if the parent window closes, and if so, close this one. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 - (void)activateTabWithContents:(content::WebContents*)newContents | 448 - (void)activateTabWithContents:(content::WebContents*)newContents |
449 previousContents:(content::WebContents*)oldContents | 449 previousContents:(content::WebContents*)oldContents |
450 atIndex:(NSInteger)index | 450 atIndex:(NSInteger)index |
451 reason:(int)reason { | 451 reason:(int)reason { |
452 // The user switched tabs; close. | 452 // The user switched tabs; close. |
453 [self closeBubble]; | 453 [self closeBubble]; |
454 } | 454 } |
455 | 455 |
456 @end // BaseBubbleController | 456 @end // BaseBubbleController |
OLD | NEW |