| 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_TRAY_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "chrome/browser/status_icons/status_tray.h" | 15 #include "chrome/browser/status_icons/status_tray.h" |
| 15 | 16 |
| 16 class StatusIconWin; | 17 class StatusIconWin; |
| 17 | 18 |
| 18 // A class that's responsible for increasing, if possible, the visibility | 19 // A class that's responsible for increasing, if possible, the visibility |
| 19 // of a status tray icon on the taskbar. The default implementation sends | 20 // of a status tray icon on the taskbar. The default implementation sends |
| 20 // a task to a worker thread each time EnqueueChange is called. | 21 // a task to a worker thread each time EnqueueChange is called. |
| 21 class StatusTrayStateChangerProxy { | 22 class StatusTrayStateChangerProxy { |
| 22 public: | 23 public: |
| 23 virtual ~StatusTrayStateChangerProxy() {} | 24 virtual ~StatusTrayStateChangerProxy() {} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 private: | 48 private: |
| 48 FRIEND_TEST_ALL_PREFIXES(StatusTrayWinTest, EnsureVisibleTest); | 49 FRIEND_TEST_ALL_PREFIXES(StatusTrayWinTest, EnsureVisibleTest); |
| 49 | 50 |
| 50 // Static callback invoked when a message comes in to our messaging window. | 51 // Static callback invoked when a message comes in to our messaging window. |
| 51 static LRESULT CALLBACK | 52 static LRESULT CALLBACK |
| 52 WndProcStatic(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); | 53 WndProcStatic(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 53 | 54 |
| 54 UINT NextIconId(); | 55 UINT NextIconId(); |
| 55 | 56 |
| 56 void SetStatusTrayStateChangerProxyForTest( | 57 void SetStatusTrayStateChangerProxyForTest( |
| 57 scoped_ptr<StatusTrayStateChangerProxy> proxy); | 58 std::unique_ptr<StatusTrayStateChangerProxy> proxy); |
| 58 | 59 |
| 59 // The unique icon ID we will assign to the next icon. | 60 // The unique icon ID we will assign to the next icon. |
| 60 UINT next_icon_id_; | 61 UINT next_icon_id_; |
| 61 | 62 |
| 62 // The window class of |window_|. | 63 // The window class of |window_|. |
| 63 ATOM atom_; | 64 ATOM atom_; |
| 64 | 65 |
| 65 // The handle of the module that contains the window procedure of |window_|. | 66 // The handle of the module that contains the window procedure of |window_|. |
| 66 HMODULE instance_; | 67 HMODULE instance_; |
| 67 | 68 |
| 68 // The window used for processing events. | 69 // The window used for processing events. |
| 69 HWND window_; | 70 HWND window_; |
| 70 | 71 |
| 71 // The message ID of the "TaskbarCreated" message, sent to us when we need to | 72 // The message ID of the "TaskbarCreated" message, sent to us when we need to |
| 72 // reset our status icons. | 73 // reset our status icons. |
| 73 UINT taskbar_created_message_; | 74 UINT taskbar_created_message_; |
| 74 | 75 |
| 75 // Manages changes performed on a background thread to manipulate visibility | 76 // Manages changes performed on a background thread to manipulate visibility |
| 76 // of notification icons. | 77 // of notification icons. |
| 77 scoped_ptr<StatusTrayStateChangerProxy> state_changer_proxy_; | 78 std::unique_ptr<StatusTrayStateChangerProxy> state_changer_proxy_; |
| 78 | 79 |
| 79 DISALLOW_COPY_AND_ASSIGN(StatusTrayWin); | 80 DISALLOW_COPY_AND_ASSIGN(StatusTrayWin); |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_ | 83 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_TRAY_WIN_H_ |
| 83 | 84 |
| OLD | NEW |