electron/browser/api/atom_api_menu_win.cc
2013-08-06 21:08:52 +08:00

33 lines
694 B
C++

// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "browser/api/atom_api_menu_win.h"
#include "ui/views/controls/menu/menu_2.h"
#include "ui/gfx/point.h"
namespace atom {
namespace api {
MenuWin::MenuWin(v8::Handle<v8::Object> wrapper)
: Menu(wrapper) {
}
MenuWin::~MenuWin() {
}
void MenuWin::Popup(NativeWindow* native_window) {
menu_.reset(new views::Menu2(model_.get()));
menu_->RunContextMenuAt(gfx::Point(0, 0));
}
// static
Menu* Menu::Create(v8::Handle<v8::Object> wrapper) {
return new MenuWin(wrapper);
}
} // namespace api
} // namespace atom