OLD | NEW |
1 // Copyright (c) 2011 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 "ash/launcher/view_model.h" | 5 #include "ash/launcher/view_model.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 | 9 |
10 namespace aura_shell { | 10 namespace ash { |
11 | 11 |
12 ViewModel::ViewModel() { | 12 ViewModel::ViewModel() { |
13 } | 13 } |
14 | 14 |
15 ViewModel::~ViewModel() { | 15 ViewModel::~ViewModel() { |
16 // view are owned by their parent, no need to delete them. | 16 // view are owned by their parent, no need to delete them. |
17 } | 17 } |
18 | 18 |
19 void ViewModel::Add(views::View* view, int index) { | 19 void ViewModel::Add(views::View* view, int index) { |
20 Entry entry; | 20 Entry entry; |
(...skipping 24 matching lines...) Expand all Loading... |
45 } | 45 } |
46 | 46 |
47 int ViewModel::GetIndexOfView(views::View* view) const { | 47 int ViewModel::GetIndexOfView(views::View* view) const { |
48 for (size_t i = 0; i < entries_.size(); ++i) { | 48 for (size_t i = 0; i < entries_.size(); ++i) { |
49 if (entries_[i].view == view) | 49 if (entries_[i].view == view) |
50 return static_cast<int>(i); | 50 return static_cast<int>(i); |
51 } | 51 } |
52 return -1; | 52 return -1; |
53 } | 53 } |
54 | 54 |
55 } // namespace aura_shell | 55 } // namespace ash |
OLD | NEW |