blob: 3050026e591a2648eb7f3128a6a9c7abf6420dd0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_
#define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_
#include <vector>
#include "base/string16.h"
class SkBitmap;
class StatusIcon {
public:
// Creates a new StatusIcon.
static StatusIcon* Create();
StatusIcon() {}
virtual ~StatusIcon() {}
// Sets the image associated with this status icon.
virtual void SetImage(const SkBitmap& image) = 0;
// Sets the image associated with this status icon when pressed.
virtual void SetPressedImage(const SkBitmap& image) = 0;
// Sets the hover text for this status icon.
virtual void SetToolTip(const string16& tool_tip) = 0;
class StatusIconObserver {
public:
virtual ~StatusIconObserver() {}
// Called when the user clicks on the system tray icon.
virtual void OnClicked() = 0;
};
// Adds/removes an observer for status bar events.
void AddObserver(StatusIconObserver* observer);
void RemoveObserver(StatusIconObserver* observer);
// Dispatches a click event to the observers.
void DispatchClickEvent();
private:
std::vector<StatusIconObserver*> observers_;
DISALLOW_COPY_AND_ASSIGN(StatusIcon);
};
#endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_
|