OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
11 | 11 |
| 12 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/win/scoped_gdi_object.h" | 14 #include "base/win/scoped_gdi_object.h" |
14 #include "chrome/browser/status_icons/status_icon.h" | 15 #include "chrome/browser/status_icons/status_icon.h" |
15 | 16 |
16 namespace views { | 17 namespace views { |
17 class Menu2; | 18 class Menu2; |
18 } | 19 } |
19 | 20 |
20 class StatusIconWin : public StatusIcon { | 21 class StatusIconWin : public StatusIcon { |
21 public: | 22 public: |
22 // Constructor which provides this icon's unique ID and messaging window. | 23 // Constructor which provides this icon's unique ID and messaging window. |
23 StatusIconWin(UINT id, HWND window, UINT message); | 24 StatusIconWin(UINT id, HWND window, UINT message); |
24 virtual ~StatusIconWin(); | 25 virtual ~StatusIconWin(); |
25 | 26 |
26 // Overridden from StatusIcon: | 27 // Overridden from StatusIcon: |
27 virtual void SetImage(const SkBitmap& image); | 28 virtual void SetImage(const SkBitmap& image) OVERRIDE; |
28 virtual void SetPressedImage(const SkBitmap& image); | 29 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; |
29 virtual void SetToolTip(const string16& tool_tip); | 30 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; |
30 virtual void DisplayBalloon(const string16& title, const string16& contents); | 31 virtual void DisplayBalloon(const SkBitmap& icon, |
| 32 const string16& title, |
| 33 const string16& contents) OVERRIDE; |
31 | 34 |
32 UINT icon_id() const { return icon_id_; } | 35 UINT icon_id() const { return icon_id_; } |
33 | 36 |
34 UINT message_id() const { return message_id_; } | 37 UINT message_id() const { return message_id_; } |
35 | 38 |
36 // Handles a click event from the user - if |left_button_click| is true and | 39 // Handles a click event from the user - if |left_button_click| is true and |
37 // there is a registered observer, passes the click event to the observer, | 40 // there is a registered observer, passes the click event to the observer, |
38 // otherwise displays the context menu if there is one. | 41 // otherwise displays the context menu if there is one. |
39 void HandleClickEvent(int x, int y, bool left_button_click); | 42 void HandleClickEvent(int x, int y, bool left_button_click); |
40 | 43 |
(...skipping 21 matching lines...) Expand all Loading... |
62 | 65 |
63 #if !defined(USE_AURA) | 66 #if !defined(USE_AURA) |
64 // Context menu associated with this icon (if any). | 67 // Context menu associated with this icon (if any). |
65 scoped_ptr<views::Menu2> context_menu_; | 68 scoped_ptr<views::Menu2> context_menu_; |
66 #endif | 69 #endif |
67 | 70 |
68 DISALLOW_COPY_AND_ASSIGN(StatusIconWin); | 71 DISALLOW_COPY_AND_ASSIGN(StatusIconWin); |
69 }; | 72 }; |
70 | 73 |
71 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ | 74 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ |
OLD | NEW |