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

Side by Side Diff: content/public/browser/host_zoom_map.h

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_
6 #define CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ 6 #define CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 // Returns the zoom level for the host or spec for a given url. The zoom 32 // Returns the zoom level for the host or spec for a given url. The zoom
33 // level is determined by the host portion of the URL, or (in the absence of 33 // level is determined by the host portion of the URL, or (in the absence of
34 // a host) the complete spec of the URL. In most cases, there is no custom 34 // a host) the complete spec of the URL. In most cases, there is no custom
35 // zoom level, and this returns the user's default zoom level. Otherwise, 35 // zoom level, and this returns the user's default zoom level. Otherwise,
36 // returns the saved zoom level, which may be positive (to zoom in) or 36 // returns the saved zoom level, which may be positive (to zoom in) or
37 // negative (to zoom out). 37 // negative (to zoom out).
38 // 38 //
39 // This may be called on any thread. 39 // This may be called on any thread.
40 virtual double GetZoomLevel(const std::string& host) const = 0; 40 virtual double GetZoomLevel(const std::string& host) const = 0;
41 41
42 // Returns the zoom level for the host or spec for a given url, taking scheme
Nikita (slow) 2013/01/11 15:23:55 nit: |scheme| |host|
Denis Kuznetsov (DE-MUC) 2013/01/11 15:48:59 Done.
43 // in account. If there is specific zoom level specified for given host and
44 // scheme pair, it will be returned. In other cases result is equivalent to
45 // GetZoomLevel(host).
46 //
47 // This may be called on any thread.
48 virtual double GetZoomLevel(const std::string& scheme,
Nikita (slow) 2013/01/11 15:23:55 Maybe name this GetZoomLevelBySchemeHost ? http:/
Denis Kuznetsov (DE-MUC) 2013/01/11 15:48:59 I would prefer to rename or remove old method, as
Nikita (slow) 2013/01/11 15:50:39 I agree that this seems like a better option.
49 const std::string& host) const = 0;
50
42 // Sets the zoom level for the host or spec for a given url to |level|. If 51 // Sets the zoom level for the host or spec for a given url to |level|. If
43 // the level matches the current default zoom level, the host is erased 52 // the level matches the current default zoom level, the host is erased
44 // from the saved preferences; otherwise the new value is written out. 53 // from the saved preferences; otherwise the new value is written out.
45 // 54 //
46 // This should only be called on the UI thread. 55 // This should only be called on the UI thread.
47 virtual void SetZoomLevel(const std::string& host, double level) = 0; 56 virtual void SetZoomLevel(const std::string& host, double level) = 0;
48 57
58 // Sets the zoom level for the host/scheme pair to |level|.
59 //
60 // This should only be called on the UI thread.
61 virtual void SetZoomLevel(const std::string& scheme,
62 const std::string& host,
63 double level) = 0;
64
49 // Get/Set the default zoom level for pages that don't override it. 65 // Get/Set the default zoom level for pages that don't override it.
50 virtual double GetDefaultZoomLevel() const = 0; 66 virtual double GetDefaultZoomLevel() const = 0;
51 virtual void SetDefaultZoomLevel(double level) = 0;; 67 virtual void SetDefaultZoomLevel(double level) = 0;;
52 68
53 protected: 69 protected:
54 virtual ~HostZoomMap() {} 70 virtual ~HostZoomMap() {}
55 }; 71 };
56 72
57 } // namespace content 73 } // namespace content
58 74
59 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_ 75 #endif // CONTENT_PUBLIC_BROWSER_HOST_ZOOM_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698