Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/common/property_bag.h

Issue 118420: Adds kind-of-live thumbnail generation for a potential tab switcher. This... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/notification_type.h ('k') | chrome/common/transport_dib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_PROPERTY_BAG_H_ 5 #ifndef CHROME_COMMON_PROPERTY_BAG_H_
6 #define CHROME_COMMON_PROPERTY_BAG_H_ 6 #define CHROME_COMMON_PROPERTY_BAG_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Provides typesafe accessor functions for a property bag, and manages the 124 // Provides typesafe accessor functions for a property bag, and manages the
125 // unique identifiers for properties via the PropertyAccessorBase. 125 // unique identifiers for properties via the PropertyAccessorBase.
126 // 126 //
127 // Note that class T must be derived from PropertyBag::Prop. 127 // Note that class T must be derived from PropertyBag::Prop.
128 template<class T> 128 template<class T>
129 class PropertyAccessor : public PropertyAccessorBase { 129 class PropertyAccessor : public PropertyAccessorBase {
130 public: 130 public:
131 PropertyAccessor() : PropertyAccessorBase() {} 131 PropertyAccessor() : PropertyAccessorBase() {}
132 virtual ~PropertyAccessor() {} 132 virtual ~PropertyAccessor() {}
133 133
134 // Takes ownership of the |prop| pointer. 134 // Makes a copy of the |prop| object for storage.
135 void SetProperty(PropertyBag* bag, const T& prop) { 135 void SetProperty(PropertyBag* bag, const T& prop) {
136 SetPropertyInternal(bag, new Container(prop)); 136 SetPropertyInternal(bag, new Container(prop));
137 } 137 }
138 138
139 // Returns our property in the given bag or NULL if there is no match. The 139 // Returns our property in the given bag or NULL if there is no match. The
140 // returned pointer's ownership will stay with the property bag. 140 // returned pointer's ownership will stay with the property bag.
141 T* GetProperty(PropertyBag* bag) { 141 T* GetProperty(PropertyBag* bag) {
142 PropertyBag::Prop* prop = GetPropertyInternal(bag); 142 PropertyBag::Prop* prop = GetPropertyInternal(bag);
143 if (!prop) 143 if (!prop)
144 return NULL; 144 return NULL;
(...skipping 21 matching lines...) Expand all
166 return new Container(data_); 166 return new Container(data_);
167 } 167 }
168 168
169 T data_; 169 T data_;
170 }; 170 };
171 171
172 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor); 172 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor);
173 }; 173 };
174 174
175 #endif // CHROME_COMMON_PROPERTY_BAG_H_ 175 #endif // CHROME_COMMON_PROPERTY_BAG_H_
OLDNEW
« no previous file with comments | « chrome/common/notification_type.h ('k') | chrome/common/transport_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698