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

Unified Diff: content/public/browser/host_zoom_map.h

Issue 12039058: content: convert zoom notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/host_zoom_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/host_zoom_map.h
diff --git a/content/public/browser/host_zoom_map.h b/content/public/browser/host_zoom_map.h
index 1e32e79383702721f3128efef30a2e0fff8f82eb..2358428706cb2802eabbcc0493b1cd2ec7283d70 100644
--- a/content/public/browser/host_zoom_map.h
+++ b/content/public/browser/host_zoom_map.h
@@ -15,6 +15,7 @@
namespace content {
class BrowserContext;
+class HostZoomMapImpl;
class ResourceContext;
// Maps hostnames to custom zoom levels. Written on the UI thread and read on
@@ -25,6 +26,29 @@ class HostZoomMap {
CONTENT_EXPORT static HostZoomMap* GetForBrowserContext(
BrowserContext* browser_context);
+ class Observer {
jam 2013/01/24 01:28:35 nit: per c++ style guide, and convention, prefer t
Paweł Hajdan Jr. 2013/01/24 19:42:38 Done.
+ public:
+ Observer();
+ explicit Observer(HostZoomMap* map);
+ virtual ~Observer();
+
+ // Called when the zoom level changes. |host| is a string of the hostname
+ // for which the zoom changed (empty string for temporary changes).
+ virtual void OnZoomLevelChanged(const std::string& host) = 0;
+
+ protected:
+ void Observe(HostZoomMap* map);
+
+ private:
+ friend class HostZoomMapImpl;
+
+ void HostZoomMapImplDestroyed();
+
+ HostZoomMapImpl* host_zoom_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(Observer);
+ };
+
// Copy the zoom levels from the given map. Can only be called on the UI
// thread.
virtual void CopyFrom(HostZoomMap* copy) = 0;
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/host_zoom_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698