OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_UTILITIES_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_UTILITIES_H_ |
| 7 #pragma once |
| 8 |
| 9 #import <Cocoa/Cocoa.h> |
| 10 |
| 11 // InfoBarUtilities provide helper functions to construct infobars with |
| 12 // similar appearance. |
| 13 namespace InfoBarUtilities { |
| 14 |
| 15 // Move the |toMove| view |spacing| pixels before/after the |anchor| view. |
| 16 // |after| signifies the side of |anchor| on which to place |toMove|. |
| 17 void MoveControl(NSView* anchor, NSView* toMove, int spacing, bool after); |
| 18 |
| 19 // Vertically center |toMove| in its container. |
| 20 void VerticallyCenterView(NSView *toMove); |
| 21 |
| 22 // Check that the control |before| is ordered visually before the |after| |
| 23 // control. Also, check that there is space between them. |
| 24 bool VerifyControlOrderAndSpacing(id before, id after); |
| 25 |
| 26 // Creates a label control in the style we need for the infobar's labels |
| 27 // within |bounds|. |
| 28 NSTextField* CreateLabel(NSRect bounds); |
| 29 |
| 30 // Adds an item with the specified properties to |menu|. |
| 31 void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title, |
| 32 int tag, bool enabled, bool checked); |
| 33 |
| 34 } // namespace InfoBarUtilities |
| 35 |
| 36 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_UTILITIES_H_ |
OLD | NEW |