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

Unified Diff: ui/views/view_model.cc

Issue 10213011: Attempt 3 at a better touch tabstrip. There is still a bunch to do, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove Tab::GetTouchModeMinimumSize Created 8 years, 8 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/views/view_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_model.cc
diff --git a/ui/views/view_model.cc b/ui/views/view_model.cc
index 8ce247434cfc02442b56e7f5987fe36480280ec0..0f18ad5ca281f32bb5662a8526b57d4c29c45e15 100644
--- a/ui/views/view_model.cc
+++ b/ui/views/view_model.cc
@@ -17,6 +17,8 @@ ViewModel::~ViewModel() {
}
void ViewModel::Add(View* view, int index) {
+ DCHECK_LE(index, static_cast<int>(entries_.size()));
+ DCHECK_GE(index, 0);
Entry entry;
entry.view = view;
entries_.insert(entries_.begin() + index, entry);
@@ -26,6 +28,7 @@ void ViewModel::Remove(int index) {
if (index == -1)
return;
+ check_index(index);
entries_.erase(entries_.begin() + index);
}
« no previous file with comments | « ui/views/view_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698