summaryrefslogtreecommitdiffstats
path: root/ui/views/view_model.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 20:32:48 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 20:32:48 +0000
commit6ecb0d97b892ab1834ebc5976135e01d771a64fe (patch)
tree630b5ef0f83354a2297ee479b683f9490e664b3d /ui/views/view_model.cc
parenta0ec8ed933f329eae68a7a301ab5932158440256 (diff)
downloadchromium_src-6ecb0d97b892ab1834ebc5976135e01d771a64fe.zip
chromium_src-6ecb0d97b892ab1834ebc5976135e01d771a64fe.tar.gz
chromium_src-6ecb0d97b892ab1834ebc5976135e01d771a64fe.tar.bz2
Gets tab dragging to work in touch mode.
BUG=123274 TEST=none Review URL: https://chromiumcodereview.appspot.com/10267023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view_model.cc')
-rw-r--r--ui/views/view_model.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/views/view_model.cc b/ui/views/view_model.cc
index 0f18ad5..5f492f5 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_);