Chromium Code Reviews| Index: chrome/browser/ui/zoom/zoom_event_manager.h |
| diff --git a/chrome/browser/ui/zoom/zoom_event_manager.h b/chrome/browser/ui/zoom/zoom_event_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef66f51974fe56ac0afb264170268bf78e3ea3d4 |
| --- /dev/null |
| +++ b/chrome/browser/ui/zoom/zoom_event_manager.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ |
| +#define CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ |
| + |
| +#include "base/callback_list.h" |
| +#include "base/supports_user_data.h" |
| +#include "content/public/browser/host_zoom_map.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +} // namespace content |
| + |
| +// This class serves as a target for event notifications from all ZoomController |
| +// objects. Classes that need to know about browser-specific zoom events (e.g. |
| +// manual-mode zoom) should subscribe here. |
| +class ZoomEventManager : public base::SupportsUserData::Data { |
|
Dan Beam
2014/06/26 03:40:02
why not ZoomObserver?
wjmaclean
2014/06/26 15:30:31
This object never subscribes to ZoomObserver event
|
| + public: |
| + ZoomEventManager(); |
| + virtual ~ZoomEventManager(); |
| + |
|
Dan Beam
2014/06/26 03:40:02
nit: doc comment (maybe when this would be NULL, i
wjmaclean
2014/06/26 15:30:31
Done.
|
| + static ZoomEventManager* GetForBrowserContext( |
| + content::BrowserContext* context); |
| + |
| + // Called by ZoomControllers when changes are made to zoom levels in manual |
| + // mode in order that browser listeners can be notified. |
| + void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| + |
| + // Add and remove zoom level changed callbacks. |
| + scoped_ptr<content::HostZoomMap::Subscription> AddZoomLevelChangedCallback( |
| + const content::HostZoomMap::ZoomLevelChangedCallback& callback); |
| + |
| + private: |
| + base::CallbackList<void(const content::HostZoomMap::ZoomLevelChange&)> |
| + zoom_level_changed_callbacks_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ZoomEventManager); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_ZOOM_ZOOM_EVENT_MANAGER_H_ |