Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: views/controls/menu/native_menu_win.cc

Issue 147230: Fix a menu crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698