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_STATUS_ICONS_STATUS_TRAY_H_
6 #define CHROME_BROWSER_STATUS_ICONS_STATUS_TRAY_H_
8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h"
10 #include "base/memory/scoped_vector.h"
11 #include "base/strings/string16.h"
19 // Provides a cross-platform interface to the system's status tray, and exposes
20 // APIs to add/remove icons to the tray and attach context menus.
24 NOTIFICATION_TRAY_ICON
= 0,
25 MEDIA_STREAM_CAPTURE_ICON
,
28 NAMED_STATUS_ICON_COUNT
31 // Static factory method that is implemented separately for each platform to
32 // produce the appropriate platform-specific instance. Returns NULL if this
33 // platform does not support status icons.
34 static StatusTray
* Create();
36 virtual ~StatusTray();
38 // Creates a new StatusIcon. The StatusTray retains ownership of the
39 // StatusIcon. Returns NULL if the StatusIcon could not be created.
40 StatusIcon
* CreateStatusIcon(StatusIconType type
,
41 const gfx::ImageSkia
& image
,
42 const base::string16
& tool_tip
);
44 // Removes |icon| from this status tray.
45 void RemoveStatusIcon(StatusIcon
* icon
);
48 typedef ScopedVector
<StatusIcon
> StatusIcons
;
52 // Factory method for creating a status icon for this platform.
53 virtual StatusIcon
* CreatePlatformStatusIcon(
55 const gfx::ImageSkia
& image
,
56 const base::string16
& tool_tip
) = 0;
58 // Returns the list of active status icons so subclasses can operate on them.
59 const StatusIcons
& status_icons() const { return status_icons_
; }
62 // List containing all active StatusIcons. The icons are owned by this
64 StatusIcons status_icons_
;
66 DISALLOW_COPY_AND_ASSIGN(StatusTray
);
69 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_TRAY_H_