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_icon_win.h" | 5 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
9 #include "chrome/browser/ui/views/status_icons/status_tray_win.h" | 9 #include "chrome/browser/ui/views/status_icons/status_tray_win.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 if (!menu_model_) | 54 if (!menu_model_) |
55 return; | 55 return; |
56 | 56 |
57 // Set our window as the foreground window, so the context menu closes when | 57 // Set our window as the foreground window, so the context menu closes when |
58 // we click away from it. | 58 // we click away from it. |
59 if (!SetForegroundWindow(window_)) | 59 if (!SetForegroundWindow(window_)) |
60 return; | 60 return; |
61 | 61 |
62 menu_runner_.reset(new views::MenuRunner(menu_model_)); | 62 menu_runner_.reset(new views::MenuRunner(menu_model_, |
63 | 63 views::MenuRunner::HAS_MNEMONICS)); |
64 ignore_result(menu_runner_->RunMenuAt(NULL, | 64 ignore_result(menu_runner_->RunMenuAt(NULL, |
65 NULL, | 65 NULL, |
66 gfx::Rect(cursor_pos, gfx::Size()), | 66 gfx::Rect(cursor_pos, gfx::Size()), |
67 views::MENU_ANCHOR_TOPLEFT, | 67 views::MENU_ANCHOR_TOPLEFT, |
68 ui::MENU_SOURCE_MOUSE, | 68 ui::MENU_SOURCE_MOUSE)); |
69 views::MenuRunner::HAS_MNEMONICS)); | |
70 } | 69 } |
71 | 70 |
72 void StatusIconWin::HandleBalloonClickEvent() { | 71 void StatusIconWin::HandleBalloonClickEvent() { |
73 if (HasObservers()) | 72 if (HasObservers()) |
74 DispatchBalloonClickEvent(); | 73 DispatchBalloonClickEvent(); |
75 } | 74 } |
76 | 75 |
77 void StatusIconWin::ResetIcon() { | 76 void StatusIconWin::ResetIcon() { |
78 NOTIFYICONDATA icon_data; | 77 NOTIFYICONDATA icon_data; |
79 InitIconData(&icon_data); | 78 InitIconData(&icon_data); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 memset(icon_data, 0, sizeof(NOTIFYICONDATA)); | 169 memset(icon_data, 0, sizeof(NOTIFYICONDATA)); |
171 icon_data->cbSize = sizeof(NOTIFYICONDATA); | 170 icon_data->cbSize = sizeof(NOTIFYICONDATA); |
172 } else { | 171 } else { |
173 memset(icon_data, 0, NOTIFYICONDATA_V3_SIZE); | 172 memset(icon_data, 0, NOTIFYICONDATA_V3_SIZE); |
174 icon_data->cbSize = NOTIFYICONDATA_V3_SIZE; | 173 icon_data->cbSize = NOTIFYICONDATA_V3_SIZE; |
175 } | 174 } |
176 | 175 |
177 icon_data->hWnd = window_; | 176 icon_data->hWnd = window_; |
178 icon_data->uID = icon_id_; | 177 icon_data->uID = icon_id_; |
179 } | 178 } |
OLD | NEW |