Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 1529713002: Update BaseBubbleController's dealloc function to use (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address rsesek@'s comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698