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

Side by Side Diff: views/focus/focus_manager.h

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 VIEWS_FOCUS_FOCUS_MANAGER_H_ 5 #ifndef VIEWS_FOCUS_FOCUS_MANAGER_H_
6 #define VIEWS_FOCUS_FOCUS_MANAGER_H_ 6 #define VIEWS_FOCUS_FOCUS_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 // The focus changed due to a click or a shortcut to jump directly to 170 // The focus changed due to a click or a shortcut to jump directly to
171 // a particular view. 171 // a particular view.
172 kReasonDirectFocusChange 172 kReasonDirectFocusChange
173 }; 173 };
174 174
175 explicit FocusManager(Widget* widget); 175 explicit FocusManager(Widget* widget);
176 virtual ~FocusManager(); 176 virtual ~FocusManager();
177 177
178 // Returns the global WidgetFocusManager instance for the running application. 178 // Returns the global WidgetFocusManager instance for the running application.
179 static WidgetFocusManager* GetWidgetFocusManager() { 179 static WidgetFocusManager* GetWidgetFocusManager();
180 return Singleton<WidgetFocusManager>::get();
181 }
182 180
183 // Processes the passed key event for accelerators and tab traversal. 181 // Processes the passed key event for accelerators and tab traversal.
184 // Returns false if the event has been consumed and should not be processed 182 // Returns false if the event has been consumed and should not be processed
185 // further. 183 // further.
186 bool OnKeyEvent(const KeyEvent& event); 184 bool OnKeyEvent(const KeyEvent& event);
187 185
188 // Returns true is the specified is part of the hierarchy of the window 186 // Returns true is the specified is part of the hierarchy of the window
189 // associated with this FocusManager. 187 // associated with this FocusManager.
190 bool ContainsView(View* view); 188 bool ContainsView(View* view);
191 189
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ~AutoNativeNotificationDisabler() { 332 ~AutoNativeNotificationDisabler() {
335 FocusManager::GetWidgetFocusManager()->EnableNotifications(); 333 FocusManager::GetWidgetFocusManager()->EnableNotifications();
336 } 334 }
337 private: 335 private:
338 DISALLOW_COPY_AND_ASSIGN(AutoNativeNotificationDisabler); 336 DISALLOW_COPY_AND_ASSIGN(AutoNativeNotificationDisabler);
339 }; 337 };
340 338
341 } // namespace views 339 } // namespace views
342 340
343 #endif // VIEWS_FOCUS_FOCUS_MANAGER_H_ 341 #endif // VIEWS_FOCUS_FOCUS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698