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

Side by Side 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: Fix test compilation. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_
6 #define CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_
7
8 #include "base/macros.h"
9 #include "content/browser/host_zoom_map_impl.h"
10 #include "content/public/browser/zoom_level_prefs_store.h"
11
12 class PrefService;
13
14 namespace base {
15 class FilePath;
16 }
17
18 namespace content {
19
20 // This class manages a HostZoomMap and, associates it with a PrefsStore,
21 // if one is provided. It also serves to keep the zoom level machinery details
22 // deparate from the owning StoragePartitionImpl.
23 class HostZoomLevelContext {
24 public:
25 HostZoomLevelContext(scoped_ptr<ZoomLevelPrefsStore> zoom_level_prefs,
26 const base::FilePath& file_path);
27 ~HostZoomLevelContext();
28
29 HostZoomMap* GetHostZoomMap() const { return host_zoom_map_impl_.get(); }
30 PrefService* GetZoomLevelPrefs() {
31 return zoom_level_prefs_ ? zoom_level_prefs_->GetPrefs() : NULL;
32 }
33
34 private:
35 scoped_ptr<HostZoomMapImpl> host_zoom_map_impl_;
36 // The prefs_store pointer needs to be released before the destructor for the
37 // HostZoomMapImpl is called, and so must be declared in this order.
38 scoped_ptr<ZoomLevelPrefsStore> zoom_level_prefs_;
39
40 DISALLOW_COPY_AND_ASSIGN(HostZoomLevelContext);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698