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

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

Issue 7461134: [Mac] Unspoofable infobars v3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_window_controller_private.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #import "base/memory/scoped_nsobject.h" 10 #import "base/memory/scoped_nsobject.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 [floatingBarBackingView_ removeFromSuperview]; 487 [floatingBarBackingView_ removeFromSuperview];
488 } 488 }
489 } 489 }
490 490
491 - (CGFloat)layoutInfoBarAtMinX:(CGFloat)minX 491 - (CGFloat)layoutInfoBarAtMinX:(CGFloat)minX
492 maxY:(CGFloat)maxY 492 maxY:(CGFloat)maxY
493 width:(CGFloat)width { 493 width:(CGFloat)width {
494 NSView* containerView = [infoBarContainerController_ view]; 494 NSView* containerView = [infoBarContainerController_ view];
495 NSRect containerFrame = [containerView frame]; 495 NSRect containerFrame = [containerView frame];
496 maxY -= NSHeight(containerFrame); 496 maxY -= NSHeight(containerFrame);
497 maxY += [infoBarContainerController_ antiSpoofHeight]; 497 maxY += [infoBarContainerController_ overlappingTipHeight];
498 containerFrame.origin.x = minX; 498 containerFrame.origin.x = minX;
499 containerFrame.origin.y = maxY; 499 containerFrame.origin.y = maxY;
500 containerFrame.size.width = width; 500 containerFrame.size.width = width;
501 [containerView setFrame:containerFrame]; 501 [containerView setFrame:containerFrame];
502 return maxY; 502 return maxY;
503 } 503 }
504 504
505 - (CGFloat)layoutDownloadShelfAtMinX:(CGFloat)minX 505 - (CGFloat)layoutDownloadShelfAtMinX:(CGFloat)minX
506 minY:(CGFloat)minY 506 minY:(CGFloat)minY
507 width:(CGFloat)width { 507 width:(CGFloat)width {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 782 }
783 783
784 // Adjust the infobar container. In fullscreen, it needs to be below all 784 // Adjust the infobar container. In fullscreen, it needs to be below all
785 // top chrome elements so it only sits atop the web contents. When in normal 785 // top chrome elements so it only sits atop the web contents. When in normal
786 // mode, it needs to draw over the bookmark bar and part of the toolbar. 786 // mode, it needs to draw over the bookmark bar and part of the toolbar.
787 [[infoBarContainerController_ view] removeFromSuperview]; 787 [[infoBarContainerController_ view] removeFromSuperview];
788 NSView* infoBarDest = [[self window] contentView]; 788 NSView* infoBarDest = [[self window] contentView];
789 [infoBarDest addSubview:[infoBarContainerController_ view] 789 [infoBarDest addSubview:[infoBarContainerController_ view]
790 positioned:fullscreen ? NSWindowBelow : NSWindowAbove 790 positioned:fullscreen ? NSWindowBelow : NSWindowAbove
791 relativeTo:fullscreen ? nil 791 relativeTo:fullscreen ? nil
792 : [bookmarkBarController_ view]]; 792 : [toolbarController_ view]];
793 } 793 }
794 794
795 - (void)contentViewDidResize:(NSNotification*)notification { 795 - (void)contentViewDidResize:(NSNotification*)notification {
796 [self layoutSubviews]; 796 [self layoutSubviews];
797 } 797 }
798 798
799 - (void)registerForContentViewResizeNotifications { 799 - (void)registerForContentViewResizeNotifications {
800 [[NSNotificationCenter defaultCenter] 800 [[NSNotificationCenter defaultCenter]
801 addObserver:self 801 addObserver:self
802 selector:@selector(contentViewDidResize:) 802 selector:@selector(contentViewDidResize:)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 - (void)disableBarVisibilityUpdates { 870 - (void)disableBarVisibilityUpdates {
871 // Early escape if there's nothing to do. 871 // Early escape if there's nothing to do.
872 if (!barVisibilityUpdatesEnabled_) 872 if (!barVisibilityUpdatesEnabled_)
873 return; 873 return;
874 874
875 barVisibilityUpdatesEnabled_ = NO; 875 barVisibilityUpdatesEnabled_ = NO;
876 [presentationModeController_ cancelAnimationAndTimers]; 876 [presentationModeController_ cancelAnimationAndTimers];
877 } 877 }
878 878
879 @end // @implementation BrowserWindowController(Private) 879 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/infobars/infobar_container_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698