blob: cba5595513c68c640d022fd4ec82b029a9014432 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "views/controls/menu/menu_host_win.h"
#include "views/controls/menu/native_menu_host_delegate.h"
namespace views {
////////////////////////////////////////////////////////////////////////////////
// MenuHostWin, public:
MenuHostWin::MenuHostWin(internal::NativeMenuHostDelegate* delegate)
: WidgetWin(delegate->AsNativeWidgetDelegate()),
delegate_(delegate) {
}
MenuHostWin::~MenuHostWin() {
}
////////////////////////////////////////////////////////////////////////////////
// MenuHostWin, NativeMenuHost implementation:
void MenuHostWin::StartCapturing() {
SetMouseCapture();
}
NativeWidget* MenuHostWin::AsNativeWidget() {
return this;
}
////////////////////////////////////////////////////////////////////////////////
// MenuHostWin, WidgetWin overrides:
void MenuHostWin::OnDestroy() {
delegate_->OnNativeMenuHostDestroy();
WidgetWin::OnDestroy();
}
void MenuHostWin::OnCancelMode() {
delegate_->OnNativeMenuHostCancelCapture();
WidgetWin::OnCancelMode();
}
////////////////////////////////////////////////////////////////////////////////
// NativeMenuHost, public:
// static
NativeMenuHost* NativeMenuHost::CreateNativeMenuHost(
internal::NativeMenuHostDelegate* delegate) {
return new MenuHostWin(delegate);
}
} // namespace views
|