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 CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 5 #ifndef COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ |
6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 6 #define COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ |
7 | 7 |
8 #include "base/callback_list.h" | 8 #include "base/callback_list.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
11 #include "content/public/browser/host_zoom_map.h" | 11 #include "content/public/browser/host_zoom_map.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class BrowserContext; | 14 class BrowserContext; |
15 } // namespace content | 15 } // namespace content |
16 | 16 |
17 namespace components { | |
18 | |
17 // This class serves as a target for event notifications from all ZoomController | 19 // This class serves as a target for event notifications from all ZoomController |
18 // objects. Classes that need to know about browser-specific zoom events (e.g. | 20 // objects. Classes that need to know about browser-specific zoom events (e.g. |
19 // manual-mode zoom) should subscribe here. | 21 // manual-mode zoom) should subscribe here. |
20 class ZoomEventManager : public base::SupportsUserData::Data { | 22 class ZoomEventManager : public base::SupportsUserData::Data { |
21 public: | 23 public: |
22 ZoomEventManager(); | 24 ZoomEventManager(); |
23 ~ZoomEventManager() override; | 25 ~ZoomEventManager() override; |
24 | 26 |
25 // Returns the ZoomEventManager for the specified BrowserContext. This | 27 // Returns the ZoomEventManager for the specified BrowserContext. This |
26 // function creates the ZoomEventManager if it hasn't been created already. | 28 // function creates the ZoomEventManager if it hasn't been created already. |
(...skipping 16 matching lines...) Expand all Loading... | |
43 } | 45 } |
44 | 46 |
45 private: | 47 private: |
46 base::CallbackList<void(const content::HostZoomMap::ZoomLevelChange&)> | 48 base::CallbackList<void(const content::HostZoomMap::ZoomLevelChange&)> |
47 zoom_level_changed_callbacks_; | 49 zoom_level_changed_callbacks_; |
48 base::WeakPtrFactory<ZoomEventManager> weak_ptr_factory_; | 50 base::WeakPtrFactory<ZoomEventManager> weak_ptr_factory_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(ZoomEventManager); | 52 DISALLOW_COPY_AND_ASSIGN(ZoomEventManager); |
51 }; | 53 }; |
52 | 54 |
53 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | 55 } // namespace extensions |
James Cook
2014/12/04 17:17:16
nit: namespace components (elsewhere too I think)
wjmaclean
2014/12/04 18:27:17
Done.
| |
56 | |
57 #endif // COMPONENTS_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ | |
OLD | NEW |