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

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

Issue 2081103002: Rename PermissionBubbleManager to PermissionRequestManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 5 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 616
617 - (void)onClose:(id)sender { 617 - (void)onClose:(id)sender {
618 DCHECK(delegate_); 618 DCHECK(delegate_);
619 delegate_->Closing(); 619 delegate_->Closing();
620 } 620 }
621 621
622 - (void)activateTabWithContents:(content::WebContents*)newContents 622 - (void)activateTabWithContents:(content::WebContents*)newContents
623 previousContents:(content::WebContents*)oldContents 623 previousContents:(content::WebContents*)oldContents
624 atIndex:(NSInteger)index 624 atIndex:(NSInteger)index
625 reason:(int)reason { 625 reason:(int)reason {
626 // The show/hide of this bubble is handled by the PermissionBubbleManager. 626 // The show/hide of this bubble is handled by the PermissionRequestManager.
627 // So bypass the base class, which would close the bubble here. 627 // So bypass the base class, which would close the bubble here.
628 } 628 }
629 629
630 + (CGFloat)matchWidthsOf:(NSView*)viewA andOf:(NSView*)viewB { 630 + (CGFloat)matchWidthsOf:(NSView*)viewA andOf:(NSView*)viewB {
631 NSRect frameA = [viewA frame]; 631 NSRect frameA = [viewA frame];
632 NSRect frameB = [viewB frame]; 632 NSRect frameB = [viewB frame];
633 CGFloat width = std::max(NSWidth(frameA), NSWidth(frameB)); 633 CGFloat width = std::max(NSWidth(frameA), NSWidth(frameB));
634 [viewA setFrameSize:NSMakeSize(width, NSHeight(frameA))]; 634 [viewA setFrameSize:NSMakeSize(width, NSHeight(frameA))];
635 [viewB setFrameSize:NSMakeSize(width, NSHeight(frameB))]; 635 [viewB setFrameSize:NSMakeSize(width, NSHeight(frameB))];
636 return width; 636 return width;
637 } 637 }
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
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/tab_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698