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

Side by Side Diff: app/view_prop.h

Issue 5075003: Converts usage of SetProp/GetProp to a map. Even after making sure we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp files Created 10 years, 1 month 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 | « app/app_base.gypi ('k') | app/view_prop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 #ifndef APP_VIEW_PROP_H_
6 #define APP_VIEW_PROP_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/ref_counted.h"
11 #include "gfx/native_widget_types.h"
12
13 namespace app {
14
15 // ViewProp maintains a key/value pair for a particular view. ViewProp is
16 // designed as a replacement for the Win32's SetProp, but does not make use of
17 // window manager memory. ViewProp shares similar semantics as SetProp, the
18 // value for a particular view/key pair comes from the last ViewProp created.
19 class ViewProp {
20 public:
21 // Associates data with a view/key pair. If a ViewProp has already been
22 // created for the specified pair |data| replaces the current value.
23 //
24 // ViewProp does *not* make a copy of the char*, the pointer is used for
25 // sorting.
26 ViewProp(gfx::NativeView view, const char* key, void* data);
27 ~ViewProp();
28
29 // Returns the value associated with the view/key pair, or NULL if there is
30 // none.
31 static void* GetValue(gfx::NativeView view, const char* key);
32
33 // Returns the key.
34 const char* Key() const;
35
36 private:
37 class Data;
38
39 // Stores the actual data.
40 scoped_refptr<Data> data_;
41
42 DISALLOW_COPY_AND_ASSIGN(ViewProp);
43 };
44
45 } // namespace app
46
47 #endif // APP_VIEW_PROP_H_
OLDNEW
« no previous file with comments | « app/app_base.gypi ('k') | app/view_prop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698