| 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 profile. | 6 // any thread. One instance per profile. |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Sets the temporary zoom level that's only valid for the lifetime of this | 59 // Sets the temporary zoom level that's only valid for the lifetime of this |
| 60 // tab. | 60 // tab. |
| 61 // | 61 // |
| 62 // This should only be called on the UI thread. | 62 // This should only be called on the UI thread. |
| 63 void SetTemporaryZoomLevel(int render_process_id, | 63 void SetTemporaryZoomLevel(int render_process_id, |
| 64 int render_view_id, | 64 int render_view_id, |
| 65 double level); | 65 double level); |
| 66 | 66 |
| 67 // NotificationObserver implementation. | 67 // NotificationObserver implementation. |
| 68 virtual void Observe(NotificationType type, | 68 virtual void Observe(int type, |
| 69 const NotificationSource& source, | 69 const NotificationSource& source, |
| 70 const NotificationDetails& details); | 70 const NotificationDetails& details); |
| 71 | 71 |
| 72 double default_zoom_level() const { return default_zoom_level_; } | 72 double default_zoom_level() const { return default_zoom_level_; } |
| 73 void set_default_zoom_level(double level) { default_zoom_level_ = level; } | 73 void set_default_zoom_level(double level) { default_zoom_level_ = level; } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 76 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; |
| 77 friend class DeleteTask<HostZoomMap>; | 77 friend class DeleteTask<HostZoomMap>; |
| 78 | 78 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 97 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and | 97 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and |
| 98 // |temporary_zoom_levels_| to guarantee thread safety. | 98 // |temporary_zoom_levels_| to guarantee thread safety. |
| 99 mutable base::Lock lock_; | 99 mutable base::Lock lock_; |
| 100 | 100 |
| 101 NotificationRegistrar registrar_; | 101 NotificationRegistrar registrar_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); | 103 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_H_ | 106 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
| OLD | NEW |