mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Rename CEF1 files from /trunk to /trunk/cef1 (issue #564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@570 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
43
cef1/libcef/browser_zoom_map.h
Normal file
43
cef1/libcef/browser_zoom_map.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2011 The Chromium Embedded Framework 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 CEF_LIBCEF_BROWSER_ZOOM_MAP_H_
|
||||
#define CEF_LIBCEF_BROWSER_ZOOM_MAP_H_
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "include/internal/cef_string.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
|
||||
// Maps the host/domain of a URL to a zoom value.
|
||||
// NOTE: This class is not thread-safe. It is assumed that the methods will be
|
||||
// called from the UI thread.
|
||||
class ZoomMap {
|
||||
public:
|
||||
// Returns the static ZoomMap instance.
|
||||
static ZoomMap* GetInstance();
|
||||
|
||||
// Store |zoomLevel| with key |url|.
|
||||
void set(const GURL& url, double zoomLevel);
|
||||
|
||||
// Returns true if there is a |zoomLevel| keyed with |url|, false otherwise.
|
||||
// |zoomLevel| is the "out" variable.
|
||||
bool get(const GURL& url, double& zoomLevel);
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, double> Map;
|
||||
Map map_;
|
||||
|
||||
friend struct DefaultSingletonTraits<ZoomMap>;
|
||||
|
||||
ZoomMap() {}
|
||||
virtual ~ZoomMap() {}
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ZoomMap);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_ZOOM_MAP_H_
|
Reference in New Issue
Block a user