| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 UINT message_id() const { return message_id_; } | 40 UINT message_id() const { return message_id_; } |
| 41 | 41 |
| 42 // Overridden from StatusIcon: | 42 // Overridden from StatusIcon: |
| 43 virtual void SetImage(const SkBitmap& image) OVERRIDE; | 43 virtual void SetImage(const SkBitmap& image) OVERRIDE; |
| 44 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; | 44 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; |
| 45 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; | 45 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; |
| 46 virtual void DisplayBalloon(const SkBitmap& icon, | 46 virtual void DisplayBalloon(const SkBitmap& icon, |
| 47 const string16& title, | 47 const string16& title, |
| 48 const string16& contents) OVERRIDE; | 48 const string16& contents) OVERRIDE; |
| 49 | 49 |
| 50 private: | 50 protected: |
| 51 // Overridden from StatusIcon: | 51 // Overridden from StatusIcon: |
| 52 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; | 52 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; |
| 53 | 53 |
| 54 private: |
| 54 void InitIconData(NOTIFYICONDATA* icon_data); | 55 void InitIconData(NOTIFYICONDATA* icon_data); |
| 55 | 56 |
| 56 // The unique ID corresponding to this icon. | 57 // The unique ID corresponding to this icon. |
| 57 UINT icon_id_; | 58 UINT icon_id_; |
| 58 | 59 |
| 59 // Window used for processing messages from this icon. | 60 // Window used for processing messages from this icon. |
| 60 HWND window_; | 61 HWND window_; |
| 61 | 62 |
| 62 // The message identifier used for status icon messages. | 63 // The message identifier used for status icon messages. |
| 63 UINT message_id_; | 64 UINT message_id_; |
| 64 | 65 |
| 65 // The currently-displayed icon for the window. | 66 // The currently-displayed icon for the window. |
| 66 base::win::ScopedHICON icon_; | 67 base::win::ScopedHICON icon_; |
| 67 | 68 |
| 68 // The currently-displayed icon for the notification balloon. | 69 // The currently-displayed icon for the notification balloon. |
| 69 base::win::ScopedHICON balloon_icon_; | 70 base::win::ScopedHICON balloon_icon_; |
| 70 | 71 |
| 71 // Not owned. | 72 // Not owned. |
| 72 ui::MenuModel* menu_model_; | 73 ui::MenuModel* menu_model_; |
| 73 | 74 |
| 74 // Context menu associated with this icon (if any). | 75 // Context menu associated with this icon (if any). |
| 75 scoped_ptr<views::MenuRunner> menu_runner_; | 76 scoped_ptr<views::MenuRunner> menu_runner_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(StatusIconWin); | 78 DISALLOW_COPY_AND_ASSIGN(StatusIconWin); |
| 78 }; | 79 }; |
| 79 | 80 |
| 81 // Implements status notifications using Windows 8 metro style notifications. |
| 82 class StatusIconMetro : public StatusIcon { |
| 83 public: |
| 84 // Constructor which provides this icon's unique ID and messaging window. |
| 85 explicit StatusIconMetro(UINT id); |
| 86 virtual ~StatusIconMetro(); |
| 87 |
| 88 // Overridden from StatusIcon: |
| 89 virtual void SetImage(const SkBitmap& image) OVERRIDE; |
| 90 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; |
| 91 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; |
| 92 virtual void DisplayBalloon(const SkBitmap& icon, |
| 93 const string16& title, |
| 94 const string16& contents) OVERRIDE; |
| 95 protected: |
| 96 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; |
| 97 |
| 98 private: |
| 99 string16 tool_tip_; |
| 100 const UINT id_; |
| 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(StatusIconMetro); |
| 103 }; |
| 104 |
| 80 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ | 105 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_WIN_H_ |
| OLD | NEW |