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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_utilities.h

Issue 10206024: Move TranslateInfoBarUtilities to a common place so that other infobars may reuse these helpers (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed avi's comments Created 8 years, 7 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698