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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/permission_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: updated BaseBubbleController's dealloc function to use unregisterFromNotifications and updated code that uses it 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 | « chrome/browser/ui/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/website_settings/permission_bubble_controller.h " 5 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h "
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/bind_objc_block.h" 9 #include "base/mac/bind_objc_block.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 247 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
248 [center addObserver:self 248 [center addObserver:self
249 selector:@selector(parentWindowDidMove:) 249 selector:@selector(parentWindowDidMove:)
250 name:NSWindowDidMoveNotification 250 name:NSWindowDidMoveNotification
251 object:[self getExpectedParentWindow]]; 251 object:[self getExpectedParentWindow]];
252 } 252 }
253 return self; 253 return self;
254 } 254 }
255 255
256 - (void)windowWillClose:(NSNotification*)notification { 256 - (void)windowWillClose:(NSNotification*)notification {
257 [[NSNotificationCenter defaultCenter] removeObserver:self];
Robert Sesek 2015/12/15 15:19:36 This should be for only the specific notification
juncai 2015/12/15 17:43:55 Done.
257 bridge_->OnBubbleClosing(); 258 bridge_->OnBubbleClosing();
258 [super windowWillClose:notification]; 259 [super windowWillClose:notification];
259 } 260 }
260 261
261 - (void)parentWindowWillToggleFullScreen:(NSNotification*)notification { 262 - (void)parentWindowWillToggleFullScreen:(NSNotification*)notification {
262 // Override the base class implementation, which would have closed the bubble. 263 // Override the base class implementation, which would have closed the bubble.
263 } 264 }
264 265
265 - (void)parentWindowDidResize:(NSNotification*)notification { 266 - (void)parentWindowDidResize:(NSNotification*)notification {
266 DCHECK(bridge_); 267 DCHECK(bridge_);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 610
610 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { 611 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB {
611 NSRect frameA = [viewA frame]; 612 NSRect frameA = [viewA frame];
612 NSRect frameB = [viewB frame]; 613 NSRect frameB = [viewB frame];
613 frameA.origin.y = 614 frameA.origin.y =
614 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); 615 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2);
615 [viewA setFrameOrigin:frameA.origin]; 616 [viewA setFrameOrigin:frameA.origin];
616 } 617 }
617 618
618 @end // implementation PermissionBubbleController 619 @end // implementation PermissionBubbleController
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698