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.
5 #ifndef CHROME_BROWSER_UI_COCOA_STATUS_ICONS_STATUS_ICON_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_STATUS_ICONS_STATUS_ICON_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/compiler_specific.h"
11 #include "base/gtest_prod_util.h"
12 #include "base/mac/scoped_nsobject.h"
13 #include "base/strings/string16.h"
14 #include "chrome/browser/status_icons/desktop_notification_balloon.h"
15 #include "chrome/browser/status_icons/status_icon.h"
17 @
class MenuController
;
19 @
class StatusItemController
;
21 class StatusIconMac
: public StatusIcon
{
24 virtual ~StatusIconMac();
26 // Overridden from StatusIcon.
27 virtual void SetImage(const gfx::ImageSkia
& image
) OVERRIDE
;
28 virtual void SetPressedImage(const gfx::ImageSkia
& image
) OVERRIDE
;
29 virtual void SetToolTip(const base::string16
& tool_tip
) OVERRIDE
;
30 virtual void DisplayBalloon(const gfx::ImageSkia
& icon
,
31 const base::string16
& title
,
32 const base::string16
& contents
) OVERRIDE
;
34 bool HasStatusIconMenu();
37 // Overridden from StatusIcon.
38 virtual void UpdatePlatformContextMenu(
39 StatusIconMenuModel
* model
) OVERRIDE
;
42 FRIEND_TEST_ALL_PREFIXES(StatusIconMacTest
, CreateMenu
);
43 FRIEND_TEST_ALL_PREFIXES(StatusIconMacTest
, MenuToolTip
);
45 void SetToolTip(NSString
* toolTip
);
46 void CreateMenu(ui::MenuModel
* model
, NSString
* toolTip
);
48 // Getter for item_ that allows lazy initialization.
50 base::scoped_nsobject
<NSStatusItem
> item_
;
52 base::scoped_nsobject
<StatusItemController
> controller_
;
54 // Notification balloon.
55 DesktopNotificationBalloon notification_
;
57 base::scoped_nsobject
<NSString
> toolTip_
;
59 // Status menu shown when right-clicking the system icon, if it has been
60 // created by |UpdatePlatformContextMenu|.
61 base::scoped_nsobject
<MenuController
> menu_
;
63 DISALLOW_COPY_AND_ASSIGN(StatusIconMac
);
66 #endif // CHROME_BROWSER_UI_COCOA_STATUS_ICONS_STATUS_ICON_MAC_H_