OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/view_model.h" | 5 #include "ui/views/view_model.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
9 | 11 |
10 namespace views { | 12 namespace views { |
11 | 13 |
12 ViewModelBase::~ViewModelBase() { | 14 ViewModelBase::~ViewModelBase() { |
13 // view are owned by their parent, no need to delete them. | 15 // view are owned by their parent, no need to delete them. |
14 } | 16 } |
15 | 17 |
16 void ViewModelBase::Remove(int index) { | 18 void ViewModelBase::Remove(int index) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 72 |
71 void ViewModelBase::AddUnsafe(View* view, int index) { | 73 void ViewModelBase::AddUnsafe(View* view, int index) { |
72 DCHECK_LE(index, static_cast<int>(entries_.size())); | 74 DCHECK_LE(index, static_cast<int>(entries_.size())); |
73 DCHECK_GE(index, 0); | 75 DCHECK_GE(index, 0); |
74 Entry entry; | 76 Entry entry; |
75 entry.view = view; | 77 entry.view = view; |
76 entries_.insert(entries_.begin() + index, entry); | 78 entries_.insert(entries_.begin() + index, entry); |
77 } | 79 } |
78 | 80 |
79 } // namespace views | 81 } // namespace views |
OLD | NEW |