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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments; patch for landing. Created 6 years, 1 month 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/profiles/profile_impl.h ('k') | chrome/browser/ui/app_list/test/fake_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 7425274d2ffaede7a730eb29a15a26a4793be01d..2c9c98e1f98e08edc8d2b6a2bb09526030ba0200 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -95,7 +95,6 @@
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/dom_storage_context.h"
-#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
@@ -156,7 +155,6 @@ using base::TimeDelta;
using base::UserMetricsAction;
using content::BrowserThread;
using content::DownloadManagerDelegate;
-using content::HostZoomMap;
namespace {
@@ -632,8 +630,6 @@ void ProfileImpl::DoFinalInit() {
session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES;
}
- InitHostZoomMap();
-
base::Callback<void(bool)> data_reduction_proxy_unavailable;
scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
data_reduction_proxy_params;
@@ -716,6 +712,9 @@ void ProfileImpl::DoFinalInit() {
content::BrowserContext::GetDefaultStoragePartition(this)->
GetDOMStorageContext()->SetSaveSessionStorageOnDisk();
+ // TODO(wjmaclean): Remove this. crbug.com/420643
+ chrome::MigrateProfileZoomLevelPrefs(this);
+
// The DomDistillerViewerSource is not a normal WebUI so it must be registered
// as a URLDataSource early.
RegisterDomDistillerViewerSource(this);
@@ -757,17 +756,6 @@ void ProfileImpl::DoFinalInit() {
#endif
}
-void ProfileImpl::InitHostZoomMap() {
- HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this);
- DCHECK(!zoom_level_prefs_);
- zoom_level_prefs_.reset(
- new chrome::ChromeZoomLevelPrefs(prefs_.get(), GetPath()));
- zoom_level_prefs_->InitPrefsAndCopyToHostZoomMap(GetPath(), host_zoom_map);
-
- // TODO(wjmaclean): Remove this. crbug.com/420643
- chrome::MigrateProfileZoomLevelPrefs(this);
-}
-
base::FilePath ProfileImpl::last_selected_directory() {
return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
}
@@ -830,6 +818,12 @@ Profile::ProfileType ProfileImpl::GetProfileType() const {
return REGULAR_PROFILE;
}
+scoped_ptr<content::ZoomLevelDelegate>
+ProfileImpl::CreateZoomLevelDelegate(const base::FilePath& partition_path) {
+ return make_scoped_ptr(
+ new chrome::ChromeZoomLevelPrefs(GetPrefs(), GetPath(), partition_path));
+}
+
base::FilePath ProfileImpl::GetPath() const {
return path_;
}
@@ -987,7 +981,8 @@ PrefService* ProfileImpl::GetPrefs() {
}
chrome::ChromeZoomLevelPrefs* ProfileImpl::GetZoomLevelPrefs() {
- return zoom_level_prefs_.get();
+ return static_cast<chrome::ChromeZoomLevelPrefs*>(
+ GetDefaultStoragePartition(this)->GetZoomLevelDelegate());
}
PrefService* ProfileImpl::GetOffTheRecordPrefs() {
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/ui/app_list/test/fake_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698