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 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
6 #define CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 6 #define CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/message_loop_helpers.h" | 14 #include "base/message_loop_helpers.h" |
| 15 #include "base/supports_user_data.h" |
15 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
16 #include "content/public/browser/host_zoom_map.h" | 17 #include "content/public/browser/host_zoom_map.h" |
17 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
19 | 20 |
20 // HostZoomMap needs to be deleted on the UI thread because it listens | 21 // HostZoomMap needs to be deleted on the UI thread because it listens |
21 // to notifications on there (and holds a NotificationRegistrar). | 22 // to notifications on there (and holds a NotificationRegistrar). |
22 class CONTENT_EXPORT HostZoomMapImpl | 23 class CONTENT_EXPORT HostZoomMapImpl |
23 : public NON_EXPORTED_BASE(content::HostZoomMap), | 24 : public NON_EXPORTED_BASE(content::HostZoomMap), |
24 public content::NotificationObserver { | 25 public content::NotificationObserver, |
| 26 public base::SupportsUserData::Data { |
25 public: | 27 public: |
26 HostZoomMapImpl(); | 28 HostZoomMapImpl(); |
27 | 29 |
28 // HostZoomMap implementation: | 30 // HostZoomMap implementation: |
29 virtual void CopyFrom(HostZoomMap* copy) OVERRIDE; | 31 virtual void CopyFrom(HostZoomMap* copy) OVERRIDE; |
30 virtual double GetZoomLevel(const std::string& host) const OVERRIDE; | 32 virtual double GetZoomLevel(const std::string& host) const OVERRIDE; |
31 virtual void SetZoomLevel(std::string host, double level) OVERRIDE; | 33 virtual void SetZoomLevel(std::string host, double level) OVERRIDE; |
32 virtual double GetDefaultZoomLevel() const OVERRIDE; | 34 virtual double GetDefaultZoomLevel() const OVERRIDE; |
33 virtual void SetDefaultZoomLevel(double level) OVERRIDE; | 35 virtual void SetDefaultZoomLevel(double level) OVERRIDE; |
34 | 36 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and | 77 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and |
76 // |temporary_zoom_levels_| to guarantee thread safety. | 78 // |temporary_zoom_levels_| to guarantee thread safety. |
77 mutable base::Lock lock_; | 79 mutable base::Lock lock_; |
78 | 80 |
79 content::NotificationRegistrar registrar_; | 81 content::NotificationRegistrar registrar_; |
80 | 82 |
81 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); | 83 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); |
82 }; | 84 }; |
83 | 85 |
84 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 86 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
OLD | NEW |