From fb804132c4cd3ad50926a21a148954f67ac656bb Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" Date: Wed, 15 Apr 2009 00:17:53 +0000 Subject: Few changes to the NTP remove thumbnails: - some minor string changes - there is now a Cancel button next to the Done button to restore the thumbnails removed during the current editing session - link and favico are opacified as well in remove mode - now using a dictionary instead of a list to store the URL blacklist for faster access - now storing URL hashes instead of URLs (for privacy and also because the DictionaryValue breaks down keys on . characters) BUG=None TEST=Make sure removing thumbnails works as expected. Start removing thumbnails then click Cancel, verify that the thumbnails just removed are restored. Review URL: http://codereview.chromium.org/69007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13723 0039d316-1c4b-4281-b951-d872f2087c98 --- base/values.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'base/values.h') diff --git a/base/values.h b/base/values.h index cad1311..fa5b1017 100644 --- a/base/values.h +++ b/base/values.h @@ -204,6 +204,9 @@ class DictionaryValue : public Value { // Returns true if the current dictionary has a value for the given key. bool HasKey(const std::wstring& key) const; + // Returns the number of Values in this dictionary. + size_t GetSize() const { return dictionary_.size(); } + // Clears any current contents of this dictionary. void Clear(); @@ -214,8 +217,8 @@ class DictionaryValue : public Value { // If the key at any step of the way doesn't exist, or exists but isn't // a DictionaryValue, a new DictionaryValue will be created and attached // to the path in that location. - // Note that the dictionary takes ownership of the value - // referenced by in_value. + // Note that the dictionary takes ownership of the value referenced by + // |in_value|. bool Set(const std::wstring& path, Value* in_value); // Convenience forms of Set(). These methods will replace any existing -- cgit v1.1