win: Add BrowserWindow.setMenu API.
This commit is contained in:
parent
2024ae5dba
commit
5a6ff0f80d
7 changed files with 54 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "browser/ui/win/menu_2.h"
|
||||
#include "common/draggable_region.h"
|
||||
#include "common/options_switches.h"
|
||||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
|
@ -325,6 +326,11 @@ gfx::NativeWindow NativeWindowWin::GetNativeWindow() {
|
|||
return window_->GetNativeView();
|
||||
}
|
||||
|
||||
void NativeWindowWin::SetMenu(ui::MenuModel* menu_model) {
|
||||
menu_.reset(new atom::Menu2(menu_model, true));
|
||||
::SetMenu(GetNativeWindow(), menu_->GetNativeMenu());
|
||||
}
|
||||
|
||||
void NativeWindowWin::UpdateDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
if (has_frame_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue