cef/libcef/browser_zoom_map.cc
Marshall Greenblatt 1073577d03 Make CEF compliant with Google/Chromium style (issue #473).
- Add a new check_style tool based on Google's cpplint that can be used to verify compliance of pending changes and specific files/directories.
- Update existing CEF source code to be compliant with the style requirements.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@463 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-09 23:46:23 +00:00

36 lines
875 B
C++

// 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;
}