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

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

Issue 9416070: Move creation and ownership of HostZoomMap to content instead of having every embedder do this. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
Index: chrome/browser/profiles/off_the_record_profile_impl_unittest.cc
===================================================================
--- chrome/browser/profiles/off_the_record_profile_impl_unittest.cc (revision 122827)
+++ chrome/browser/profiles/off_the_record_profile_impl_unittest.cc (working copy)
@@ -24,20 +24,14 @@
class TestingProfileWithHostZoomMap : public TestingProfile,
public content::NotificationObserver {
public:
- TestingProfileWithHostZoomMap() {}
+ TestingProfileWithHostZoomMap() {
+ HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this);
+ registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
+ content::Source<HostZoomMap>(host_zoom_map));
+ }
virtual ~TestingProfileWithHostZoomMap() {}
- virtual HostZoomMap* GetHostZoomMap() {
- if (!host_zoom_map_) {
- host_zoom_map_ = HostZoomMap::Create();
-
- registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
- content::Source<HostZoomMap>(host_zoom_map_));
- }
- return host_zoom_map_.get();
- }
-
virtual Profile* GetOffTheRecordProfile() OVERRIDE {
if (!off_the_record_profile_.get())
off_the_record_profile_.reset(CreateOffTheRecordProfile());
@@ -70,7 +64,6 @@
private:
content::NotificationRegistrar registrar_;
- scoped_refptr<HostZoomMap> host_zoom_map_;
scoped_ptr<Profile> off_the_record_profile_;
scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_;
@@ -133,7 +126,8 @@
ASSERT_TRUE(parent_profile->GetOffTheRecordPrefs());
// Prepare parent host zoom map.
- HostZoomMap* parent_zoom_map = parent_profile->GetHostZoomMap();
+ HostZoomMap* parent_zoom_map =
+ HostZoomMap::GetForBrowserContext(parent_profile);
ASSERT_TRUE(parent_zoom_map);
parent_zoom_map->SetZoomLevel(host, zoom_level_25);
@@ -147,7 +141,8 @@
new OffTheRecordProfileImpl(parent_profile.get()));
// Prepare child host zoom map.
- HostZoomMap* child_zoom_map = child_profile->GetHostZoomMap();
+ HostZoomMap* child_zoom_map =
+ HostZoomMap::GetForBrowserContext(child_profile);
ASSERT_TRUE(child_zoom_map);
// Verity.

Powered by Google App Engine
This is Rietveld 408576698