Chromium Code Reviews| 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..d2e0053e7702a580126a57116bd992503eac84ff |
| --- /dev/null |
| +++ b/content/browser/host_zoom_level_context.h |
| @@ -0,0 +1,47 @@ |
| +// 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 { |
|
Fady Samuel
2014/08/13 19:45:42
Explain the purpose of this class here.
wjmaclean
2014/08/14 18:18:21
Done.
|
| + public: |
| + HostZoomLevelContext(scoped_ptr<ZoomLevelPrefsDelegate> delegate, |
| + const base::FilePath& file_path, |
| + double default_zoom_level); |
| + ~HostZoomLevelContext(); |
| + |
| + HostZoomMapImpl* GetHostZoomMap() const { return host_zoom_map_impl_.get(); } |
| + PrefService* GetZoomLevelPrefs() { |
| + return delegate_ ? delegate_->GetPrefs() : NULL; |
| + } |
| + |
| + private: |
| + scoped_ptr<HostZoomMapImpl> host_zoom_map_impl_; |
| + // The delegate pointer needs to be released before the destructor for the |
| + // HostZoomMapImpl is called, and so must be declared in this order. |
| + scoped_ptr<ZoomLevelPrefsDelegate> delegate_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(HostZoomLevelContext); |
| +}; // HostZoomLevelContext |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_HOST_ZOOM_LEVEL_CONTEXT |