OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/bookmarks_enhanced/image_store.h" |
| 6 |
| 7 #include "url/gurl.h" |
| 8 |
| 9 ImageStore::ImageStore() { |
| 10 } |
| 11 |
| 12 void ImageStore::ChangeImageURL(const GURL& from, const GURL& to) { |
| 13 DCHECK(thread_checker_.CalledOnValidThread()); |
| 14 |
| 15 if (!HasKey(from)) |
| 16 return; |
| 17 |
| 18 std::pair<gfx::Image, GURL> image_info = Get(from); |
| 19 Erase(from); |
| 20 Insert(to, image_info.second, image_info.first); |
| 21 } |
| 22 |
| 23 void ImageStore::ClearAll() { |
| 24 DCHECK(thread_checker_.CalledOnValidThread()); |
| 25 |
| 26 std::set<GURL> all_keys; |
| 27 GetAllPageUrls(&all_keys); |
| 28 for (std::set<GURL>::const_iterator it = all_keys.begin(); |
| 29 it != all_keys.end(); |
| 30 ++it) { |
| 31 Erase(*it); |
| 32 } |
| 33 } |
| 34 |
| 35 ImageStore::~ImageStore() { |
| 36 } |
OLD | NEW |