| 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 "ui/views/controls/menu/native_menu_win.h" | 5 #include "ui/views/controls/menu/native_menu_win.h" |
| 6 | 6 |
| 7 #include <Windowsx.h> | 7 #include <Windowsx.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 mi.cbSize = sizeof(mi); | 67 mi.cbSize = sizeof(mi); |
| 68 mi.fMask = MIM_MENUDATA | MIM_STYLE; | 68 mi.fMask = MIM_MENUDATA | MIM_STYLE; |
| 69 GetMenuInfo(hmenu, &mi); | 69 GetMenuInfo(hmenu, &mi); |
| 70 return reinterpret_cast<NativeMenuWin*>(mi.dwMenuData); | 70 return reinterpret_cast<NativeMenuWin*>(mi.dwMenuData); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // A window that receives messages from Windows relevant to the native menu | 73 // A window that receives messages from Windows relevant to the native menu |
| 74 // structure we have constructed in NativeMenuWin. | 74 // structure we have constructed in NativeMenuWin. |
| 75 class NativeMenuWin::MenuHostWindow { | 75 class NativeMenuWin::MenuHostWindow { |
| 76 public: | 76 public: |
| 77 MenuHostWindow(NativeMenuWin* parent) : parent_(parent) { | 77 explicit MenuHostWindow(NativeMenuWin* parent) : parent_(parent) { |
| 78 RegisterClass(); | 78 RegisterClass(); |
| 79 hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, | 79 hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, |
| 80 L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); | 80 L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); |
| 81 ui::CheckWindowCreated(hwnd_); | 81 ui::CheckWindowCreated(hwnd_); |
| 82 ui::SetWindowUserData(hwnd_, this); | 82 ui::SetWindowUserData(hwnd_, this); |
| 83 } | 83 } |
| 84 | 84 |
| 85 ~MenuHostWindow() { | 85 ~MenuHostWindow() { |
| 86 DestroyWindow(hwnd_); | 86 DestroyWindow(hwnd_); |
| 87 } | 87 } |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 //////////////////////////////////////////////////////////////////////////////// | 742 //////////////////////////////////////////////////////////////////////////////// |
| 743 // MenuWrapper, public: | 743 // MenuWrapper, public: |
| 744 | 744 |
| 745 // static | 745 // static |
| 746 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { | 746 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { |
| 747 return new NativeMenuWin(model, NULL); | 747 return new NativeMenuWin(model, NULL); |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace views | 750 } // namespace views |
| OLD | NEW |