OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FOCUS_WIDGET_FOCUS_MANAGER_H_ | 5 #ifndef UI_VIEWS_FOCUS_WIDGET_FOCUS_MANAGER_H_ |
6 #define UI_VIEWS_FOCUS_WIDGET_FOCUS_MANAGER_H_ | 6 #define UI_VIEWS_FOCUS_WIDGET_FOCUS_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // propagating notifications. | 46 // propagating notifications. |
47 void EnableNotifications() { enabled_ = true; } | 47 void EnableNotifications() { enabled_ = true; } |
48 void DisableNotifications() { enabled_ = false; } | 48 void DisableNotifications() { enabled_ = false; } |
49 | 49 |
50 private: | 50 private: |
51 friend struct DefaultSingletonTraits<WidgetFocusManager>; | 51 friend struct DefaultSingletonTraits<WidgetFocusManager>; |
52 | 52 |
53 WidgetFocusManager(); | 53 WidgetFocusManager(); |
54 ~WidgetFocusManager(); | 54 ~WidgetFocusManager(); |
55 | 55 |
56 ObserverList<WidgetFocusChangeListener> focus_change_listeners_; | 56 base::ObserverList<WidgetFocusChangeListener> focus_change_listeners_; |
57 | 57 |
58 bool enabled_; | 58 bool enabled_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(WidgetFocusManager); | 60 DISALLOW_COPY_AND_ASSIGN(WidgetFocusManager); |
61 }; | 61 }; |
62 | 62 |
63 // A basic helper class that is used to disable native focus change | 63 // A basic helper class that is used to disable native focus change |
64 // notifications within a scope. | 64 // notifications within a scope. |
65 class VIEWS_EXPORT AutoNativeNotificationDisabler { | 65 class VIEWS_EXPORT AutoNativeNotificationDisabler { |
66 public: | 66 public: |
67 AutoNativeNotificationDisabler(); | 67 AutoNativeNotificationDisabler(); |
68 ~AutoNativeNotificationDisabler(); | 68 ~AutoNativeNotificationDisabler(); |
69 | 69 |
70 private: | 70 private: |
71 DISALLOW_COPY_AND_ASSIGN(AutoNativeNotificationDisabler); | 71 DISALLOW_COPY_AND_ASSIGN(AutoNativeNotificationDisabler); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace views | 74 } // namespace views |
75 | 75 |
76 #endif // UI_VIEWS_FOCUS_WIDGET_FOCUS_MANAGER_H_ | 76 #endif // UI_VIEWS_FOCUS_WIDGET_FOCUS_MANAGER_H_ |
OLD | NEW |