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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 : public NON_EXPORTED_BASE(content::HostZoomMap), | 24 : public NON_EXPORTED_BASE(content::HostZoomMap), |
25 public content::NotificationObserver, | 25 public content::NotificationObserver, |
26 public base::SupportsUserData::Data { | 26 public base::SupportsUserData::Data { |
27 public: | 27 public: |
28 HostZoomMapImpl(); | 28 HostZoomMapImpl(); |
29 virtual ~HostZoomMapImpl(); | 29 virtual ~HostZoomMapImpl(); |
30 | 30 |
31 // HostZoomMap implementation: | 31 // HostZoomMap implementation: |
32 virtual void CopyFrom(HostZoomMap* copy) OVERRIDE; | 32 virtual void CopyFrom(HostZoomMap* copy) OVERRIDE; |
33 virtual double GetZoomLevel(const std::string& host) const OVERRIDE; | 33 virtual double GetZoomLevel(const std::string& host) const OVERRIDE; |
34 virtual void SetZoomLevel(std::string host, double level) OVERRIDE; | 34 virtual void SetZoomLevel(const std::string& host, double level) OVERRIDE; |
35 virtual double GetDefaultZoomLevel() const OVERRIDE; | 35 virtual double GetDefaultZoomLevel() const OVERRIDE; |
36 virtual void SetDefaultZoomLevel(double level) OVERRIDE; | 36 virtual void SetDefaultZoomLevel(double level) OVERRIDE; |
37 | 37 |
38 // Returns the temporary zoom level that's only valid for the lifetime of | 38 // Returns the temporary zoom level that's only valid for the lifetime of |
39 // the given WebContents (i.e. isn't saved and doesn't affect other | 39 // the given WebContents (i.e. isn't saved and doesn't affect other |
40 // WebContentses) if it exists, the default zoom level otherwise. | 40 // WebContentses) if it exists, the default zoom level otherwise. |
41 // | 41 // |
42 // This may be called on any thread. | 42 // This may be called on any thread. |
43 double GetTemporaryZoomLevel(int render_process_id, | 43 double GetTemporaryZoomLevel(int render_process_id, |
44 int render_view_id) const; | 44 int render_view_id) const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and | 76 // Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and |
77 // |temporary_zoom_levels_| to guarantee thread safety. | 77 // |temporary_zoom_levels_| to guarantee thread safety. |
78 mutable base::Lock lock_; | 78 mutable base::Lock lock_; |
79 | 79 |
80 content::NotificationRegistrar registrar_; | 80 content::NotificationRegistrar registrar_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); | 82 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); |
83 }; | 83 }; |
84 | 84 |
85 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ | 85 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ |
OLD | NEW |