| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
| 14 #include "base/supports_user_data.h" | |
| 15 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 16 #include "content/public/browser/host_zoom_map.h" | 15 #include "content/public/browser/host_zoom_map.h" |
| 17 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 | 20 |
| 22 class WebContentsImpl; | 21 class WebContentsImpl; |
| 23 | 22 |
| 24 // HostZoomMap needs to be deleted on the UI thread because it listens | 23 // HostZoomMap needs to be deleted on the UI thread because it listens |
| 25 // to notifications on there (and holds a NotificationRegistrar). | 24 // to notifications on there (and holds a NotificationRegistrar). |
| 26 class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), | 25 class CONTENT_EXPORT HostZoomMapImpl : public NON_EXPORTED_BASE(HostZoomMap), |
| 27 public NotificationObserver, | 26 public NotificationObserver { |
| 28 public base::SupportsUserData::Data { | |
| 29 public: | 27 public: |
| 30 HostZoomMapImpl(); | 28 HostZoomMapImpl(); |
| 31 ~HostZoomMapImpl() override; | 29 ~HostZoomMapImpl() override; |
| 32 | 30 |
| 33 // HostZoomMap implementation: | 31 // HostZoomMap implementation: |
| 34 void CopyFrom(HostZoomMap* copy) override; | 32 void CopyFrom(HostZoomMap* copy) override; |
| 35 double GetZoomLevelForHostAndScheme(const std::string& scheme, | 33 double GetZoomLevelForHostAndScheme(const std::string& scheme, |
| 36 const std::string& host) const override; | 34 const std::string& host) const override; |
| 37 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 | 35 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 |
| 38 bool HasZoomLevel(const std::string& scheme, | 36 bool HasZoomLevel(const std::string& scheme, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 mutable base::Lock lock_; | 132 mutable base::Lock lock_; |
| 135 | 133 |
| 136 NotificationRegistrar registrar_; | 134 NotificationRegistrar registrar_; |
| 137 | 135 |
| 138 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); | 136 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); |
| 139 }; | 137 }; |
| 140 | 138 |
| 141 } // namespace content | 139 } // namespace content |
| 142 | 140 |
| 143 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 141 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
| OLD | NEW |