| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Protocol for basic container methods, as needed by an InfoBarController. | 23 // Protocol for basic container methods, as needed by an InfoBarController. |
| 24 // This protocol exists to make mocking easier in unittests. | 24 // This protocol exists to make mocking easier in unittests. |
| 25 @protocol InfoBarContainer | 25 @protocol InfoBarContainer |
| 26 - (void)willRemoveController:(InfoBarController*)controller; | 26 - (void)willRemoveController:(InfoBarController*)controller; |
| 27 - (void)removeController:(InfoBarController*)controller; | 27 - (void)removeController:(InfoBarController*)controller; |
| 28 @end | 28 @end |
| 29 | 29 |
| 30 | 30 |
| 31 namespace infobars { | 31 namespace infobars { |
| 32 | 32 |
| 33 // How tall the tip is on a normal infobar. | 33 // The height of an infobar without the tip. |
| 34 const CGFloat kBaseHeight = 36.0; | 34 const CGFloat kBaseHeight = 36.0; |
| 35 | 35 |
| 36 // The height of the infobar tip. |
| 37 const CGFloat kTipHeight = 12.0; |
| 38 |
| 36 }; // namespace infobars | 39 }; // namespace infobars |
| 37 | 40 |
| 38 | 41 |
| 39 // Controller for the infobar container view, which is the superview | 42 // Controller for the infobar container view, which is the superview |
| 40 // of all the infobar views. This class owns zero or more | 43 // of all the infobar views. This class owns zero or more |
| 41 // InfoBarControllers, which manage the infobar views. This class | 44 // InfoBarControllers, which manage the infobar views. This class |
| 42 // also receives tab strip model notifications and handles | 45 // also receives tab strip model notifications and handles |
| 43 // adding/removing infobars when needed. | 46 // adding/removing infobars when needed. |
| 44 @interface InfoBarContainerController : NSViewController <ViewResizer, | 47 @interface InfoBarContainerController : NSViewController <ViewResizer, |
| 45 InfoBarContainer> { | 48 InfoBarContainer> { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // if |contents| is the current tab contents. | 91 // if |contents| is the current tab contents. |
| 89 - (void)tabDetachedWithContents:(TabContentsWrapper*)contents; | 92 - (void)tabDetachedWithContents:(TabContentsWrapper*)contents; |
| 90 | 93 |
| 91 // Returns the number of active infobars. This is | 94 // Returns the number of active infobars. This is |
| 92 // |infobarControllers_ - closingInfoBars_|. | 95 // |infobarControllers_ - closingInfoBars_|. |
| 93 - (NSUInteger)infobarCount; | 96 - (NSUInteger)infobarCount; |
| 94 | 97 |
| 95 // Returns the amount of additional height the container view needs to draw the | 98 // Returns the amount of additional height the container view needs to draw the |
| 96 // anti-spoofing tip. This will return 0 if |-infobarCount| is 0. This is the | 99 // anti-spoofing tip. This will return 0 if |-infobarCount| is 0. This is the |
| 97 // total amount of overlap for all infobars. | 100 // total amount of overlap for all infobars. |
| 98 - (CGFloat)antiSpoofHeight; | 101 - (CGFloat)overlappingTipHeight; |
| 99 | 102 |
| 100 @end | 103 @end |
| 101 | 104 |
| 102 | 105 |
| 103 @interface InfoBarContainerController (ForTheObserverAndTesting) | 106 @interface InfoBarContainerController (ForTheObserverAndTesting) |
| 104 | 107 |
| 105 // Adds the given infobar. Takes ownership of |infobar|. | 108 // Adds the given infobar. Takes ownership of |infobar|. |
| 106 - (void)addInfoBar:(InfoBar*)infobar animate:(BOOL)animate; | 109 - (void)addInfoBar:(InfoBar*)infobar animate:(BOOL)animate; |
| 107 | 110 |
| 108 // Closes all the infobar views for a given delegate, either immediately or by | 111 // Closes all the infobar views for a given delegate, either immediately or by |
| (...skipping 13 matching lines...) Expand all Loading... |
| 122 // Removes all infobar views. Infobars which were already closing will be | 125 // Removes all infobar views. Infobars which were already closing will be |
| 123 // completely closed (i.e. InfobarDelegate::InfoBarClosed() will be called and | 126 // completely closed (i.e. InfobarDelegate::InfoBarClosed() will be called and |
| 124 // we'll get a callback to removeController). Other infobars will simply stop | 127 // we'll get a callback to removeController). Other infobars will simply stop |
| 125 // animating and disappear. Callers must call positionInfoBarsAndRedraw() | 128 // animating and disappear. Callers must call positionInfoBarsAndRedraw() |
| 126 // after calling this method. | 129 // after calling this method. |
| 127 - (void)removeAllInfoBars; | 130 - (void)removeAllInfoBars; |
| 128 | 131 |
| 129 @end | 132 @end |
| 130 | 133 |
| 131 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ | 134 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_CONTAINER_CONTROLLER_H_ |
| OLD | NEW |