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> |
(...skipping 18 matching lines...) Expand all Loading... |
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(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 tab (i.e. isn't saved and doesn't affect other tabs) if it | 39 // the given WebContents (i.e. isn't saved and doesn't affect other |
40 // 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; |
45 | 45 |
46 // Sets the temporary zoom level that's only valid for the lifetime of this | 46 // Sets the temporary zoom level that's only valid for the lifetime of this |
47 // tab. | 47 // WebContents. |
48 // | 48 // |
49 // This should only be called on the UI thread. | 49 // This should only be called on the UI thread. |
50 void SetTemporaryZoomLevel(int render_process_id, | 50 void SetTemporaryZoomLevel(int render_process_id, |
51 int render_view_id, | 51 int render_view_id, |
52 double level); | 52 double level); |
53 | 53 |
54 // content::NotificationObserver implementation. | 54 // content::NotificationObserver implementation. |
55 virtual void Observe(int type, | 55 virtual void Observe(int type, |
56 const content::NotificationSource& source, | 56 const content::NotificationSource& source, |
57 const content::NotificationDetails& details) OVERRIDE; | 57 const content::NotificationDetails& details) OVERRIDE; |
(...skipping 18 matching lines...) Expand all 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 |