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

Unified Diff: chrome/browser/host_zoom_map.cc

Issue 1744003: Send content settings based on the URL to the renderer instead of just the host. (Closed)
Patch Set: nits Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/host_zoom_map.h ('k') | chrome/browser/host_zoom_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/host_zoom_map.cc
diff --git a/chrome/browser/host_zoom_map.cc b/chrome/browser/host_zoom_map.cc
index f83d6f63993da3c6e35a4fee8de80efc2c8a345c..c646b0db967fd618f56b1e47e7ef6d71e9f8fecd 100644
--- a/chrome/browser/host_zoom_map.cc
+++ b/chrome/browser/host_zoom_map.cc
@@ -13,6 +13,8 @@
#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/net_util.h"
HostZoomMap::HostZoomMap(Profile* profile)
: profile_(profile),
@@ -50,19 +52,19 @@ void HostZoomMap::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterDictionaryPref(prefs::kPerHostZoomLevels);
}
-int HostZoomMap::GetZoomLevel(const std::string& host) const {
+int HostZoomMap::GetZoomLevel(const GURL& url) const {
+ std::string host(net::GetHostOrSpecFromURL(url));
AutoLock auto_lock(lock_);
HostZoomLevels::const_iterator i(host_zoom_levels_.find(host));
return (i == host_zoom_levels_.end()) ? 0 : i->second;
}
-void HostZoomMap::SetZoomLevel(const std::string& host, int level) {
+void HostZoomMap::SetZoomLevel(const GURL& url, int level) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
if (!profile_)
return;
- if (host.empty())
- return;
+ std::string host(net::GetHostOrSpecFromURL(url));
{
AutoLock auto_lock(lock_);
« no previous file with comments | « chrome/browser/host_zoom_map.h ('k') | chrome/browser/host_zoom_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698