summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 23:49:51 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 23:49:51 +0000
commit40bd658fd9aeedc8f2f7cc17c835f41095df9189 (patch)
tree87e9562263a8a641f7d2da19f629a2737d67c041 /chrome/browser/profile.cc
parent1c42268bc05d715b59d1b535e432c0d9ef666113 (diff)
downloadchromium_src-40bd658fd9aeedc8f2f7cc17c835f41095df9189.zip
chromium_src-40bd658fd9aeedc8f2f7cc17c835f41095df9189.tar.gz
chromium_src-40bd658fd9aeedc8f2f7cc17c835f41095df9189.tar.bz2
Remember zoom on a per-host basis.
BUG=567 TEST=Visit a page, zoom in or out, then navigate to a different host. The new page should not be zoomed. Go back, or restart, or open a new tab and navigate to the old page, and it should be zoomed. Review URL: http://codereview.chromium.org/437077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 5cdeb3e..530c902 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -29,6 +29,7 @@
#include "chrome/browser/spellcheck_host.h"
#include "chrome/browser/strict_transport_security_persister.h"
#include "chrome/browser/history/history.h"
+#include "chrome/browser/host_zoom_map.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/ssl_config_service_manager.h"
@@ -403,6 +404,14 @@ class OffTheRecordProfileImpl : public Profile,
return GetOriginalProfile()->GetSSLConfigService();
}
+ virtual HostZoomMap* GetHostZoomMap() {
+ // Need to use a separate map from the normal one to avoid persisting zoom
+ // changes in OTR mode.
+ if (!host_zoom_map_)
+ host_zoom_map_ = new HostZoomMap(this);
+ return host_zoom_map_.get();
+ }
+
virtual BlacklistManager* GetBlacklistManager() {
return GetOriginalProfile()->GetBlacklistManager();
}
@@ -525,6 +534,8 @@ class OffTheRecordProfileImpl : public Profile,
scoped_refptr<ChromeURLRequestContextGetter> extensions_request_context_;
+ scoped_refptr<HostZoomMap> host_zoom_map_;
+
// The download manager that only stores downloaded items in memory.
scoped_refptr<DownloadManager> download_manager_;
@@ -560,6 +571,7 @@ ProfileImpl::ProfileImpl(const FilePath& path)
request_context_(NULL),
media_request_context_(NULL),
extensions_request_context_(NULL),
+ host_zoom_map_(NULL),
blacklist_manager_(NULL),
blacklist_manager_created_(false),
history_service_created_(false),
@@ -952,6 +964,12 @@ net::SSLConfigService* ProfileImpl::GetSSLConfigService() {
return ssl_config_service_manager_->Get();
}
+HostZoomMap* ProfileImpl::GetHostZoomMap() {
+ if (!host_zoom_map_)
+ host_zoom_map_ = new HostZoomMap(this);
+ return host_zoom_map_.get();
+}
+
BlacklistManager* ProfileImpl::GetBlacklistManager() {
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePrivacyBlacklists)) {