| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LEVEL_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_ | 6 #define CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/browser/host_zoom_map_impl.h" | 12 #include "content/browser/host_zoom_map_impl.h" |
| 13 #include "content/public/browser/zoom_level_delegate.h" | 13 #include "content/public/browser/zoom_level_delegate.h" |
| 14 | 14 |
| 15 class PrefService; | |
| 16 | |
| 17 namespace content { | 15 namespace content { |
| 18 struct HostZoomLevelContextDeleter; | 16 struct HostZoomLevelContextDeleter; |
| 19 | 17 |
| 20 // This class manages a HostZoomMap and associates it with a ZoomLevelDelegate, | 18 // This class manages a HostZoomMap and associates it with a ZoomLevelDelegate, |
| 21 // if one is provided. It also serves to keep the zoom level machinery details | 19 // if one is provided. It also serves to keep the zoom level machinery details |
| 22 // separate from the owning StoragePartitionImpl. | 20 // separate from the owning StoragePartitionImpl. |
| 23 class HostZoomLevelContext | 21 class HostZoomLevelContext |
| 24 : public base::RefCountedThreadSafe<HostZoomLevelContext, | 22 : public base::RefCountedThreadSafe<HostZoomLevelContext, |
| 25 HostZoomLevelContextDeleter> { | 23 HostZoomLevelContextDeleter> { |
| 26 public: | 24 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 53 | 51 |
| 54 struct HostZoomLevelContextDeleter { | 52 struct HostZoomLevelContextDeleter { |
| 55 static void Destruct(const HostZoomLevelContext* context) { | 53 static void Destruct(const HostZoomLevelContext* context) { |
| 56 context->DeleteOnCorrectThread(); | 54 context->DeleteOnCorrectThread(); |
| 57 } | 55 } |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 } // namespace content | 58 } // namespace content |
| 61 | 59 |
| 62 #endif // CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_ | 60 #endif // CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_ |
| OLD | NEW |