OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "app/view_prop.h" | 5 #include "ui/base/view_prop.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 namespace app { | 9 namespace ui { |
10 | 10 |
11 // Maints the actual view, key and data. | 11 // Maints the actual view, key and data. |
12 class ViewProp::Data : public base::RefCounted<ViewProp::Data> { | 12 class ViewProp::Data : public base::RefCounted<ViewProp::Data> { |
13 public: | 13 public: |
14 // Returns the Data* for the view/key pair. If |create| is false and |Get| | 14 // Returns the Data* for the view/key pair. If |create| is false and |Get| |
15 // has not been invoked for the view/key pair, NULL is returned. | 15 // has not been invoked for the view/key pair, NULL is returned. |
16 static void Get(gfx::NativeView view, | 16 static void Get(gfx::NativeView view, |
17 const char* key, | 17 const char* key, |
18 bool create, | 18 bool create, |
19 scoped_refptr<Data>* data) { | 19 scoped_refptr<Data>* data) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 scoped_refptr<Data> data; | 93 scoped_refptr<Data> data; |
94 Data::Get(view, key, false, &data); | 94 Data::Get(view, key, false, &data); |
95 return data.get() ? data->data() : NULL; | 95 return data.get() ? data->data() : NULL; |
96 } | 96 } |
97 | 97 |
98 // static | 98 // static |
99 const char* ViewProp::Key() const { | 99 const char* ViewProp::Key() const { |
100 return data_->key(); | 100 return data_->key(); |
101 } | 101 } |
102 | 102 |
103 } // namespace app | 103 } // namespace ui |
OLD | NEW |