OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 5 #ifndef COMPONENTS_ZOOM_ZOOM_EVENT_MANAGER_H_ |
6 #define COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 6 #define COMPONENTS_ZOOM_ZOOM_EVENT_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback_list.h" | 10 #include "base/callback_list.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/supports_user_data.h" | 14 #include "base/supports_user_data.h" |
15 #include "content/public/browser/host_zoom_map.h" | 15 #include "content/public/browser/host_zoom_map.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class BrowserContext; | 18 class BrowserContext; |
19 } // namespace content | 19 } // namespace content |
20 | 20 |
21 namespace ui_zoom { | 21 namespace zoom { |
22 | 22 |
23 class ZoomEventManagerObserver; | 23 class ZoomEventManagerObserver; |
24 | 24 |
25 // This class serves as a target for event notifications from all ZoomController | 25 // This class serves as a target for event notifications from all ZoomController |
26 // objects. Classes that need to know about browser-specific zoom events (e.g. | 26 // objects. Classes that need to know about browser-specific zoom events (e.g. |
27 // manual-mode zoom) should subscribe here. | 27 // manual-mode zoom) should subscribe here. |
28 class ZoomEventManager : public base::SupportsUserData::Data { | 28 class ZoomEventManager : public base::SupportsUserData::Data { |
29 public: | 29 public: |
30 ZoomEventManager(); | 30 ZoomEventManager(); |
31 ~ZoomEventManager() override; | 31 ~ZoomEventManager() override; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 private: | 64 private: |
65 base::CallbackList<void(const content::HostZoomMap::ZoomLevelChange&)> | 65 base::CallbackList<void(const content::HostZoomMap::ZoomLevelChange&)> |
66 zoom_level_changed_callbacks_; | 66 zoom_level_changed_callbacks_; |
67 base::ObserverList<ZoomEventManagerObserver> observers_; | 67 base::ObserverList<ZoomEventManagerObserver> observers_; |
68 base::WeakPtrFactory<ZoomEventManager> weak_ptr_factory_; | 68 base::WeakPtrFactory<ZoomEventManager> weak_ptr_factory_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(ZoomEventManager); | 70 DISALLOW_COPY_AND_ASSIGN(ZoomEventManager); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace ui_zoom | 73 } // namespace zoom |
74 | 74 |
75 #endif // COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 75 #endif // COMPONENTS_ZOOM_ZOOM_EVENT_MANAGER_H_ |
OLD | NEW |