win: Fix context menu clicking in notify icon.
This commit is contained in:
parent
9ef7ecbdaf
commit
53092cfb7c
2 changed files with 5 additions and 3 deletions
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#include "atom/browser/ui/win/notify_icon.h"
|
#include "atom/browser/ui/win/notify_icon.h"
|
||||||
|
|
||||||
#include "atom/browser/ui/win/menu_2.h"
|
|
||||||
#include "atom/browser/ui/win/notify_icon_host.h"
|
#include "atom/browser/ui/win/notify_icon_host.h"
|
||||||
|
#include "atom/browser/ui/win/menu_2.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
|
@ -60,8 +60,8 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
|
||||||
if (!SetForegroundWindow(window_))
|
if (!SetForegroundWindow(window_))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scoped_ptr<Menu2> menu(new Menu2(menu_model_));
|
menu_.reset(new Menu2(menu_model_));
|
||||||
menu->RunContextMenuAt(cursor_pos);
|
menu_->RunContextMenuAt(cursor_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyIcon::ResetIcon() {
|
void NotifyIcon::ResetIcon() {
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Point;
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
class Menu2;
|
||||||
class NotifyIconHost;
|
class NotifyIconHost;
|
||||||
|
|
||||||
class NotifyIcon : public TrayIcon {
|
class NotifyIcon : public TrayIcon {
|
||||||
|
@ -68,6 +69,7 @@ class NotifyIcon : public TrayIcon {
|
||||||
|
|
||||||
// The context menu.
|
// The context menu.
|
||||||
ui::SimpleMenuModel* menu_model_;
|
ui::SimpleMenuModel* menu_model_;
|
||||||
|
scoped_ptr<atom::Menu2> menu_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NotifyIcon);
|
DISALLOW_COPY_AND_ASSIGN(NotifyIcon);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue