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

Unified Diff: content/browser/host_zoom_level_context.h

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 years, 4 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: content/browser/host_zoom_level_context.h
diff --git a/content/browser/host_zoom_level_context.h b/content/browser/host_zoom_level_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..af1ef2143d4214685c992c35f7d98348d3aefac5
--- /dev/null
+++ b/content/browser/host_zoom_level_context.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2014 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.
+
+#ifndef CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT
+#define CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT
+
+#include <string>
+
+#include "base/files/file_path.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "content/public/browser/host_zoom_map.h"
+#include "content/public/browser/zoom_level_prefs_delegate.h"
+
+class JsonPrefStore;
+class PrefService;
+class PrefServiceSyncable;
+
+namespace content {
+
+class HostZoomMapImpl;
+
+class HostZoomLevelContext
+ : public base::RefCountedThreadSafe<HostZoomLevelContext> {
awong 2014/08/12 21:07:06 Can this be expressed as single-ownership? The res
wjmaclean 2014/08/13 17:16:03 Done.
+ public:
+ HostZoomLevelContext(ZoomLevelPrefsDelegate* delegate,
+ const base::FilePath& file_path,
+ double default_zoom_level);
+
+ HostZoomMapImpl* GetHostZoomMap() const { return host_zoom_map_impl_.get(); }
+ PrefService* GetZoomLevelPrefs() {
+ return delegate_ ? delegate_->GetPrefs() : NULL;
+ }
+
+ private:
+ friend class base::RefCountedThreadSafe<HostZoomLevelContext>;
+
+ virtual ~HostZoomLevelContext();
+
+ scoped_ptr<HostZoomMapImpl> host_zoom_map_impl_;
+ scoped_refptr<ZoomLevelPrefsDelegate> delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(HostZoomLevelContext);
+}; // HostZoomLevelContext
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT

Powered by Google App Engine
This is Rietveld 408576698