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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm

Issue 2227513002: MacViews: Reposition permission bubble on browser resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
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/macros.h" 10 #include "base/macros.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 name:NSWindowDidMoveNotification 292 name:NSWindowDidMoveNotification
293 object:nil]; 293 object:nil];
294 bridge_->OnBubbleClosing(); 294 bridge_->OnBubbleClosing();
295 [super windowWillClose:notification]; 295 [super windowWillClose:notification];
296 } 296 }
297 297
298 - (void)parentWindowWillToggleFullScreen:(NSNotification*)notification { 298 - (void)parentWindowWillToggleFullScreen:(NSNotification*)notification {
299 // Override the base class implementation, which would have closed the bubble. 299 // Override the base class implementation, which would have closed the bubble.
300 } 300 }
301 301
302 - (void)parentWindowDidResize:(NSNotification*)notification { 302 - (void)parentWindowDidResize:(NSNotification*)notification {
tapted 2016/08/08 07:10:18 we can just delete this - it's overriding a "priva
karandeepb 2016/08/08 10:37:29 Wouldn't that make a call to the base class versio
tapted 2016/08/09 01:58:39 Ah, yeh there might be a race depending on observe
karandeepb 2016/08/09 07:51:32 Done.
303 DCHECK(bridge_); 303 // It's not necessary to call updateAnchorPosition since
304 [self updateAnchorPosition]; 304 // BrowserWindowController will do that.
305 } 305 }
306 306
307 - (void)parentWindowDidMove:(NSNotification*)notification { 307 - (void)parentWindowDidMove:(NSNotification*)notification {
308 DCHECK(bridge_); 308 DCHECK(bridge_);
309 [self setAnchorPoint:[self getExpectedAnchorPoint]]; 309 [self setAnchorPoint:[self getExpectedAnchorPoint]];
310 } 310 }
311 311
312 - (void)showWithDelegate:(PermissionPrompt::Delegate*)delegate 312 - (void)showWithDelegate:(PermissionPrompt::Delegate*)delegate
313 forRequests:(const std::vector<PermissionRequest*>&)requests 313 forRequests:(const std::vector<PermissionRequest*>&)requests
314 acceptStates:(const std::vector<bool>&)acceptStates { 314 acceptStates:(const std::vector<bool>&)acceptStates {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { 639 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB {
640 NSRect frameA = [viewA frame]; 640 NSRect frameA = [viewA frame];
641 NSRect frameB = [viewB frame]; 641 NSRect frameB = [viewB frame];
642 frameA.origin.y = 642 frameA.origin.y =
643 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); 643 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2);
644 [viewA setFrameOrigin:frameA.origin]; 644 [viewA setFrameOrigin:frameA.origin];
645 } 645 }
646 646
647 @end // implementation PermissionBubbleController 647 @end // implementation PermissionBubbleController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698