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

Side by Side Diff: ui/views/controls/menu/native_menu_win.h

Issue 1103713003: win: Move a few WeakPtrFactories to the end of their containing classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
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 #ifndef UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // A list of listeners to call when the menu opens. 139 // A list of listeners to call when the menu opens.
140 ObserverList<MenuListener> listeners_; 140 ObserverList<MenuListener> listeners_;
141 141
142 // Keep track of whether the listeners have already been called at least 142 // Keep track of whether the listeners have already been called at least
143 // once. 143 // once.
144 bool listeners_called_; 144 bool listeners_called_;
145 145
146 // See comment in MenuMessageHook for details on these. 146 // See comment in MenuMessageHook for details on these.
147 NativeMenuWin* menu_to_select_; 147 NativeMenuWin* menu_to_select_;
148 int position_to_select_; 148 int position_to_select_;
149 base::WeakPtrFactory<NativeMenuWin> menu_to_select_factory_;
150 149
151 // If we're a submenu, this is our parent. 150 // If we're a submenu, this is our parent.
152 NativeMenuWin* parent_; 151 NativeMenuWin* parent_;
153 152
154 // If non-null the destructor sets this to true. This is set to non-null while 153 // If non-null the destructor sets this to true. This is set to non-null while
155 // the menu is showing. It is used to detect if the menu was deleted while 154 // the menu is showing. It is used to detect if the menu was deleted while
156 // running. 155 // running.
157 bool* destroyed_flag_; 156 bool* destroyed_flag_;
158 157
158 base::WeakPtrFactory<NativeMenuWin> menu_to_select_factory_;
159
159 // Ugly: a static pointer to the instance of this class that currently 160 // Ugly: a static pointer to the instance of this class that currently
160 // has a menu open, because our hook function that receives keyboard 161 // has a menu open, because our hook function that receives keyboard
161 // events doesn't have a mechanism to get a user data pointer. 162 // events doesn't have a mechanism to get a user data pointer.
162 static NativeMenuWin* open_native_menu_win_; 163 static NativeMenuWin* open_native_menu_win_;
163 164
164 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin); 165 DISALLOW_COPY_AND_ASSIGN(NativeMenuWin);
165 }; 166 };
166 167
167 } // namespace views 168 } // namespace views
168 169
169 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 170 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/dxva_video_decode_accelerator.cc ('k') | ui/views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698