status_tray_win.h revision a36e5920737c6adbddd3e43b760e5de8431db6e0
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_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_
6#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_
7
8#include <windows.h>
9
10#include "base/compiler_specific.h"
11#include "chrome/browser/status_icons/status_tray.h"
12
13class StatusTrayWin : public StatusTray {
14 public:
15  StatusTrayWin();
16  ~StatusTrayWin();
17
18  // Exposed for testing.
19  LRESULT CALLBACK WndProc(HWND hwnd,
20                           UINT message,
21                           WPARAM wparam,
22                           LPARAM lparam);
23
24 protected:
25  // Overriden from StatusTray:
26  virtual StatusIcon* CreatePlatformStatusIcon(
27      StatusIconType type,
28      const gfx::ImageSkia& image,
29      const string16& tool_tip) OVERRIDE;
30
31 private:
32  // Static callback invoked when a message comes in to our messaging window.
33  static LRESULT CALLBACK WndProcStatic(HWND hwnd,
34                                        UINT message,
35                                        WPARAM wparam,
36                                        LPARAM lparam);
37
38  UINT NextIconId();
39
40  // The unique icon ID we will assign to the next icon.
41  UINT next_icon_id_;
42
43  // The window class of |window_|.
44  ATOM atom_;
45
46  // The handle of the module that contains the window procedure of |window_|.
47  HMODULE instance_;
48
49  // The window used for processing events.
50  HWND window_;
51
52  // The message ID of the "TaskbarCreated" message, sent to us when we need to
53  // reset our status icons.
54  UINT taskbar_created_message_;
55
56  DISALLOW_COPY_AND_ASSIGN(StatusTrayWin);
57};
58
59#endif  // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_
60
61