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 #include "chrome/browser/ui/views/status_icons/status_tray_win.h" | 5 #include "chrome/browser/ui/views/status_icons/status_tray_win.h" |
6 | 6 |
7 #include <commctrl.h> | 7 #include <commctrl.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 switch (lparam) { | 185 switch (lparam) { |
186 case TB_INDETERMINATE: | 186 case TB_INDETERMINATE: |
187 win_icon->HandleBalloonClickEvent(); | 187 win_icon->HandleBalloonClickEvent(); |
188 return TRUE; | 188 return TRUE; |
189 | 189 |
190 case WM_LBUTTONDOWN: | 190 case WM_LBUTTONDOWN: |
191 case WM_RBUTTONDOWN: | 191 case WM_RBUTTONDOWN: |
192 case WM_CONTEXTMENU: | 192 case WM_CONTEXTMENU: |
193 // Walk our icons, find which one was clicked on, and invoke its | 193 // Walk our icons, find which one was clicked on, and invoke its |
194 // HandleClickEvent() method. | 194 // HandleClickEvent() method. |
195 gfx::Point cursor_pos( | 195 gfx::Point cursor_pos(gfx::Screen::GetScreen()->GetCursorScreenPoint()); |
196 gfx::Screen::GetNativeScreen()->GetCursorScreenPoint()); | |
197 win_icon->HandleClickEvent(cursor_pos, lparam == WM_LBUTTONDOWN); | 196 win_icon->HandleClickEvent(cursor_pos, lparam == WM_LBUTTONDOWN); |
198 return TRUE; | 197 return TRUE; |
199 } | 198 } |
200 } else if (message == WM_ENDSESSION) { | 199 } else if (message == WM_ENDSESSION) { |
201 // If Chrome is in background-only mode, this is the only notification | 200 // If Chrome is in background-only mode, this is the only notification |
202 // it gets that Windows is exiting. Make sure we shutdown in an orderly | 201 // it gets that Windows is exiting. Make sure we shutdown in an orderly |
203 // fashion. | 202 // fashion. |
204 chrome::SessionEnding(); | 203 chrome::SessionEnding(); |
205 } | 204 } |
206 return ::DefWindowProc(hwnd, message, wparam, lparam); | 205 return ::DefWindowProc(hwnd, message, wparam, lparam); |
(...skipping 23 matching lines...) Expand all Loading... |
230 } | 229 } |
231 | 230 |
232 void StatusTrayWin::SetStatusTrayStateChangerProxyForTest( | 231 void StatusTrayWin::SetStatusTrayStateChangerProxyForTest( |
233 scoped_ptr<StatusTrayStateChangerProxy> proxy) { | 232 scoped_ptr<StatusTrayStateChangerProxy> proxy) { |
234 state_changer_proxy_ = proxy.Pass(); | 233 state_changer_proxy_ = proxy.Pass(); |
235 } | 234 } |
236 | 235 |
237 StatusTray* StatusTray::Create() { | 236 StatusTray* StatusTray::Create() { |
238 return new StatusTrayWin(); | 237 return new StatusTrayWin(); |
239 } | 238 } |
OLD | NEW |