| 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/metro.h" | 8 #include "base/win/metro.h" |
| 9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Set our window as the foreground window, so the context menu closes when | 54 // Set our window as the foreground window, so the context menu closes when |
| 55 // we click away from it. | 55 // we click away from it. |
| 56 if (!SetForegroundWindow(window_)) | 56 if (!SetForegroundWindow(window_)) |
| 57 return; | 57 return; |
| 58 | 58 |
| 59 menu_runner_.reset(new views::MenuRunner(menu_model_)); | 59 menu_runner_.reset(new views::MenuRunner(menu_model_)); |
| 60 | 60 |
| 61 ignore_result(menu_runner_->RunMenuAt(NULL, NULL, | 61 ignore_result(menu_runner_->RunMenuAt(NULL, NULL, |
| 62 gfx::Rect(cursor_pos, gfx::Size()), views::MenuItemView::TOPLEFT, | 62 gfx::Rect(cursor_pos, gfx::Size()), views::MenuItemView::TOPLEFT, |
| 63 views::MenuRunner::HAS_MNEMONICS)); | 63 ui::MENU_SOURCE_MOUSE, views::MenuRunner::HAS_MNEMONICS)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void StatusIconWin::ResetIcon() { | 66 void StatusIconWin::ResetIcon() { |
| 67 NOTIFYICONDATA icon_data; | 67 NOTIFYICONDATA icon_data; |
| 68 InitIconData(&icon_data); | 68 InitIconData(&icon_data); |
| 69 // Delete any previously existing icon. | 69 // Delete any previously existing icon. |
| 70 Shell_NotifyIcon(NIM_DELETE, &icon_data); | 70 Shell_NotifyIcon(NIM_DELETE, &icon_data); |
| 71 InitIconData(&icon_data); | 71 InitIconData(&icon_data); |
| 72 icon_data.uFlags = NIF_MESSAGE; | 72 icon_data.uFlags = NIF_MESSAGE; |
| 73 icon_data.uCallbackMessage = message_id_; | 73 icon_data.uCallbackMessage = message_id_; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 notification("", "", title.c_str(), contents.c_str(), L"", | 200 notification("", "", title.c_str(), contents.c_str(), L"", |
| 201 base::IntToString(id_).c_str(), NULL, NULL); | 201 base::IntToString(id_).c_str(), NULL, NULL); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 void StatusIconMetro::UpdatePlatformContextMenu(ui::MenuModel* menu) { | 205 void StatusIconMetro::UpdatePlatformContextMenu(ui::MenuModel* menu) { |
| 206 DVLOG(1) << __FUNCTION__ | 206 DVLOG(1) << __FUNCTION__ |
| 207 << " This functionality is not supported in Windows 8 metro"; | 207 << " This functionality is not supported in Windows 8 metro"; |
| 208 } | 208 } |
| 209 | 209 |
| OLD | NEW |