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

Unified Diff: ui/views/view_model.cc

Issue 10267023: Gets tab dragging to work in touch mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup 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') | ui/views/view_model_unittest.cc » ('j') | 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 0f18ad5ca281f32bb5662a8526b57d4c29c45e15..5f492f5380d7b27e0114dca16fa333bda0f377ec 100644
--- a/ui/views/view_model.cc
+++ b/ui/views/view_model.cc
@@ -40,6 +40,22 @@ void ViewModel::Move(int index, int target_index) {
entries_.insert(entries_.begin() + target_index, entry);
}
+void ViewModel::MoveViewOnly(int index, int target_index) {
+ if (index == target_index)
+ return;
+ if (target_index < index) {
+ View* view = entries_[index].view;
+ for (int i = index; i > target_index; --i)
+ entries_[i].view = entries_[i - 1].view;
+ entries_[target_index].view = view;
+ } else {
+ View* view = entries_[index].view;
+ for (int i = index; i < target_index; ++i)
+ entries_[i].view = entries_[i + 1].view;
+ entries_[target_index].view = view;
+ }
+}
+
void ViewModel::Clear() {
Entries entries;
entries.swap(entries_);
« no previous file with comments | « ui/views/view_model.h ('k') | ui/views/view_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698