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

Unified Diff: ui/base/models/list_model.h

Issue 10386118: ui: Do not expose the underline type (vector) used in ListModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_model.cc ('k') | ui/base/models/list_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/list_model.h
diff --git a/ui/base/models/list_model.h b/ui/base/models/list_model.h
index 3634ed1f895cf901364f3290834893c6107ae60e..9352fa5f220afa3155e49568fdeafde3a0e9fc57 100644
--- a/ui/base/models/list_model.h
+++ b/ui/base/models/list_model.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,8 +8,8 @@
#include "base/basictypes.h"
#include "base/logging.h"
-#include "base/observer_list.h"
#include "base/memory/scoped_vector.h"
+#include "base/observer_list.h"
#include "ui/base/models/list_model_observer.h"
namespace ui {
@@ -20,8 +20,6 @@ namespace ui {
template <class ItemType>
class ListModel {
public:
- typedef std::vector<ItemType*> Items;
-
ListModel() {}
virtual ~ListModel() {}
@@ -93,15 +91,14 @@ class ListModel {
}
int item_count() const { return static_cast<int>(items_.size()); }
- const Items& items() const { return items_.get(); }
- const ItemType* item_at(int index) const {
+ const ItemType* GetItemAt(int index) const {
DCHECK(index >= 0 && index < item_count());
return items_[index];
}
- ItemType* item_at(int index) {
+ ItemType* GetItemAt(int index) {
return const_cast<ItemType*>(
- const_cast<const ListModel<ItemType>*>(this)->item_at(index));
+ const_cast<const ListModel<ItemType>*>(this)->GetItemAt(index));
}
private:
« no previous file with comments | « ui/app_list/app_list_model.cc ('k') | ui/base/models/list_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698