Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: content/browser/host_zoom_map_impl.h

Issue 2630583002: Add setting to isolate zoom changes by default. (Closed)
Patch Set: Add more tests. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <tuple> 10 #include <tuple>
(...skipping 18 matching lines...) Expand all
29 public: 29 public:
30 HostZoomMapImpl(); 30 HostZoomMapImpl();
31 ~HostZoomMapImpl() override; 31 ~HostZoomMapImpl() override;
32 32
33 // HostZoomMap implementation: 33 // HostZoomMap implementation:
34 void SetPageScaleFactorIsOneForView( 34 void SetPageScaleFactorIsOneForView(
35 int render_process_id, int render_view_id, bool is_one) override; 35 int render_process_id, int render_view_id, bool is_one) override;
36 void ClearPageScaleFactorIsOneForView( 36 void ClearPageScaleFactorIsOneForView(
37 int render_process_id, int render_view_id) override; 37 int render_process_id, int render_view_id) override;
38 void CopyFrom(HostZoomMap* copy) override; 38 void CopyFrom(HostZoomMap* copy) override;
39 void PreserveTemporaryZoomLevelFrom(
40 const HostZoomMap* copy, RenderFrameHost* old_host,
41 RenderFrameHost* new_host) override;
39 double GetZoomLevelForHostAndScheme(const std::string& scheme, 42 double GetZoomLevelForHostAndScheme(const std::string& scheme,
40 const std::string& host) const override; 43 const std::string& host) const override;
41 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486 44 // TODO(wjmaclean) Should we use a GURL here? crbug.com/384486
42 bool HasZoomLevel(const std::string& scheme, 45 bool HasZoomLevel(const std::string& scheme,
43 const std::string& host) const override; 46 const std::string& host) const override;
44 ZoomLevelVector GetAllZoomLevels() const override; 47 ZoomLevelVector GetAllZoomLevels() const override;
45 void SetZoomLevelForHost(const std::string& host, double level) override; 48 void SetZoomLevelForHost(const std::string& host, double level) override;
46 void SetZoomLevelForHostAndScheme(const std::string& scheme, 49 void SetZoomLevelForHostAndScheme(const std::string& scheme,
47 const std::string& host, 50 const std::string& host,
48 double level) override; 51 double level) override;
(...skipping 25 matching lines...) Expand all
74 double level); 77 double level);
75 78
76 // Sets the zoom level for the specified view. The level may be set for only 79 // Sets the zoom level for the specified view. The level may be set for only
77 // this view, or for the host, depending on UsesTemporaryZoomLevel(). 80 // this view, or for the host, depending on UsesTemporaryZoomLevel().
78 void SetZoomLevelForView(int render_process_id, 81 void SetZoomLevelForView(int render_process_id,
79 int render_view_id, 82 int render_view_id,
80 double level, 83 double level,
81 const std::string& host); 84 const std::string& host);
82 85
83 // Returns the temporary zoom level that's only valid for the lifetime of 86 // Returns the temporary zoom level that's only valid for the lifetime of
84 // the given WebContents (i.e. isn't saved and doesn't affect other 87 // the given view (i.e. isn't saved and doesn't affect other WebContentses)
85 // WebContentses) if it exists, the default zoom level otherwise. 88 // if it exists, the default zoom level otherwise.
86 // 89 //
87 // This may be called on any thread. 90 // This may be called on any thread.
88 double GetTemporaryZoomLevel(int render_process_id, 91 double GetTemporaryZoomLevel(int render_process_id,
89 int render_view_id) const; 92 int render_view_id) const;
90 93
91 // Returns the zoom level regardless of whether it's temporary, host-keyed or 94 // Returns the zoom level regardless of whether it's temporary, host-keyed or
92 // scheme+host-keyed. 95 // scheme+host-keyed.
93 // 96 //
94 // This may be called on any thread. 97 // This may be called on any thread.
95 double GetZoomLevelForView(const GURL& url, 98 double GetZoomLevelForView(const GURL& url,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 mutable base::Lock lock_; 160 mutable base::Lock lock_;
158 161
159 NotificationRegistrar registrar_; 162 NotificationRegistrar registrar_;
160 163
161 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl); 164 DISALLOW_COPY_AND_ASSIGN(HostZoomMapImpl);
162 }; 165 };
163 166
164 } // namespace content 167 } // namespace content
165 168
166 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_ 169 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698