mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Create 1453 release branch for CEF1.
git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1453@1184 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
35
cef1/libcef/browser_zoom_map.cc
Normal file
35
cef1/libcef/browser_zoom_map.cc
Normal file
@@ -0,0 +1,35 @@
|
||||
// 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.
|
||||
|
||||
#include "libcef/browser_zoom_map.h"
|
||||
#include "libcef/cef_thread.h"
|
||||
|
||||
ZoomMap* ZoomMap::GetInstance() {
|
||||
return Singleton<ZoomMap>::get();
|
||||
}
|
||||
|
||||
void ZoomMap::set(const GURL& url, double zoomLevel) {
|
||||
REQUIRE_UIT();
|
||||
|
||||
if (zoomLevel == 0.) {
|
||||
// Remove the entry for this host.
|
||||
Map::iterator iter = map_.find(url.host());
|
||||
if (iter != map_.end())
|
||||
map_.erase(iter);
|
||||
} else {
|
||||
// Update the entry for this host.
|
||||
map_[url.host()] = zoomLevel;
|
||||
}
|
||||
}
|
||||
|
||||
bool ZoomMap::get(const GURL& url, double& zoomLevel) {
|
||||
REQUIRE_UIT();
|
||||
|
||||
Map::const_iterator iter = map_.find(url.host());
|
||||
if (iter == map_.end())
|
||||
return false;
|
||||
|
||||
zoomLevel = iter->second;
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user