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 // Maps hostnames to custom zoom levels. Written on the UI thread and read on | 5 // Maps hostnames to custom zoom levels. Written on the UI thread and read on |
6 // any thread. One instance per browser context. | 6 // any thread. One instance per browser context. |
7 | 7 |
8 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_H_ | 8 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
9 #define CONTENT_BROWSER_HOST_ZOOM_MAP_H_ | 9 #define CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // tab. | 62 // tab. |
63 // | 63 // |
64 // This should only be called on the UI thread. | 64 // This should only be called on the UI thread. |
65 void SetTemporaryZoomLevel(int render_process_id, | 65 void SetTemporaryZoomLevel(int render_process_id, |
66 int render_view_id, | 66 int render_view_id, |
67 double level); | 67 double level); |
68 | 68 |
69 // content::NotificationObserver implementation. | 69 // content::NotificationObserver implementation. |
70 virtual void Observe(int type, | 70 virtual void Observe(int type, |
71 const content::NotificationSource& source, | 71 const content::NotificationSource& source, |
72 const content::NotificationDetails& details); | 72 const content::NotificationDetails& details) OVERRIDE; |
73 | 73 |
74 double default_zoom_level() const { return default_zoom_level_; } | 74 double default_zoom_level() const { return default_zoom_level_; } |
75 void set_default_zoom_level(double level) { default_zoom_level_ = level; } | 75 void set_default_zoom_level(double level) { default_zoom_level_ = level; } |
76 | 76 |
77 HostZoomMap* GetOriginal() const { return original_; } | 77 HostZoomMap* GetOriginal() const { return original_; } |
78 | 78 |
79 private: | 79 private: |
80 friend class base::RefCountedThreadSafe< | 80 friend class base::RefCountedThreadSafe< |
81 HostZoomMap, content::BrowserThread::DeleteOnUIThread>; | 81 HostZoomMap, content::BrowserThread::DeleteOnUIThread>; |
82 friend struct content::BrowserThread::DeleteOnThread< | 82 friend struct content::BrowserThread::DeleteOnThread< |
(...skipping 25 matching lines...) Expand all Loading... |
108 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and | 108 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and |
109 // |temporary_zoom_levels_| to guarantee thread safety. | 109 // |temporary_zoom_levels_| to guarantee thread safety. |
110 mutable base::Lock lock_; | 110 mutable base::Lock lock_; |
111 | 111 |
112 content::NotificationRegistrar registrar_; | 112 content::NotificationRegistrar registrar_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); | 114 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); |
115 }; | 115 }; |
116 | 116 |
117 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_H_ | 117 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
OLD | NEW |