| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/menu/native_menu_win.h" | 5 #include "views/controls/menu/native_menu_win.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class NativeMenuWin::MenuHostWindow { | 51 class NativeMenuWin::MenuHostWindow { |
| 52 public: | 52 public: |
| 53 MenuHostWindow() { | 53 MenuHostWindow() { |
| 54 RegisterClass(); | 54 RegisterClass(); |
| 55 hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, | 55 hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, |
| 56 L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); | 56 L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); |
| 57 SetProp(hwnd_, kMenuHostWindowKey, this); | 57 SetProp(hwnd_, kMenuHostWindowKey, this); |
| 58 } | 58 } |
| 59 | 59 |
| 60 ~MenuHostWindow() { | 60 ~MenuHostWindow() { |
| 61 RemoveProp(hwnd_, kMenuHostWindowKey); |
| 61 DestroyWindow(hwnd_); | 62 DestroyWindow(hwnd_); |
| 62 } | 63 } |
| 63 | 64 |
| 64 HWND hwnd() const { return hwnd_; } | 65 HWND hwnd() const { return hwnd_; } |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 static const wchar_t* kMenuHostWindowKey; | 68 static const wchar_t* kMenuHostWindowKey; |
| 68 static const wchar_t* kWindowClassName; | 69 static const wchar_t* kWindowClassName; |
| 69 | 70 |
| 70 void RegisterClass() { | 71 void RegisterClass() { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 532 |
| 532 //////////////////////////////////////////////////////////////////////////////// | 533 //////////////////////////////////////////////////////////////////////////////// |
| 533 // MenuWrapper, public: | 534 // MenuWrapper, public: |
| 534 | 535 |
| 535 // static | 536 // static |
| 536 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { | 537 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { |
| 537 return new NativeMenuWin(menu->model(), NULL); | 538 return new NativeMenuWin(menu->model(), NULL); |
| 538 } | 539 } |
| 539 | 540 |
| 540 } // namespace views | 541 } // namespace views |
| OLD | NEW |