diff options
Diffstat (limited to 'chrome/browser/history/page_usage_data.cc')
-rw-r--r-- | chrome/browser/history/page_usage_data.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/history/page_usage_data.cc b/chrome/browser/history/page_usage_data.cc new file mode 100644 index 0000000..f202538 --- /dev/null +++ b/chrome/browser/history/page_usage_data.cc @@ -0,0 +1,35 @@ +// Copyright (c) 2006-2008 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. + +#include "chrome/browser/history/page_usage_data.h" + +#include <algorithm> + +#include "third_party/skia/include/core/SkBitmap.h" + +PageUsageData::~PageUsageData() { + delete thumbnail_; + delete favicon_; +} + +void PageUsageData::SetThumbnail(SkBitmap* img) { + if (thumbnail_ && thumbnail_ != img) + delete thumbnail_; + + thumbnail_ = img; + thumbnail_set_ = true; +} + +void PageUsageData::SetFavIcon(SkBitmap* img) { + if (favicon_ && favicon_ != img) + delete favicon_; + favicon_ = img; + favicon_set_ = true; +} + +// static +bool PageUsageData::Predicate(const PageUsageData* lhs, + const PageUsageData* rhs) { + return lhs->GetScore() > rhs->GetScore(); +} |