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 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" | 5 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "gfx/icon_util.h" | |
9 #include "gfx/point.h" | |
10 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "ui/gfx/icon_util.h" |
| 10 #include "ui/gfx/point.h" |
11 #include "views/controls/menu/menu_2.h" | 11 #include "views/controls/menu/menu_2.h" |
12 | 12 |
13 StatusIconWin::StatusIconWin(UINT id, HWND window, UINT message) | 13 StatusIconWin::StatusIconWin(UINT id, HWND window, UINT message) |
14 : icon_id_(id), | 14 : icon_id_(id), |
15 window_(window), | 15 window_(window), |
16 message_id_(message) { | 16 message_id_(message) { |
17 NOTIFYICONDATA icon_data; | 17 NOTIFYICONDATA icon_data; |
18 InitIconData(&icon_data); | 18 InitIconData(&icon_data); |
19 icon_data.uFlags = NIF_MESSAGE; | 19 icon_data.uFlags = NIF_MESSAGE; |
20 icon_data.uCallbackMessage = message_id_; | 20 icon_data.uCallbackMessage = message_id_; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 // Event not sent to the observer, so display the context menu if one exists. | 106 // Event not sent to the observer, so display the context menu if one exists. |
107 if (context_menu_.get()) { | 107 if (context_menu_.get()) { |
108 // Set our window as the foreground window, so the context menu closes when | 108 // Set our window as the foreground window, so the context menu closes when |
109 // we click away from it. | 109 // we click away from it. |
110 SetForegroundWindow(window_); | 110 SetForegroundWindow(window_); |
111 context_menu_->RunContextMenuAt(gfx::Point(x, y)); | 111 context_menu_->RunContextMenuAt(gfx::Point(x, y)); |
112 } | 112 } |
113 } | 113 } |
OLD | NEW |