diff options
author | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 02:27:46 +0000 |
---|---|---|
committer | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 02:27:46 +0000 |
commit | 073359ddf6af218fe7834a060837d4229813de0a (patch) | |
tree | 8e40d8e23bf337ff1c085dea2abc03a70dc1f3ef /ui/app_list/test | |
parent | 6e407f9634ce026d518d1e15dcda82219fc493f4 (diff) | |
download | chromium_src-073359ddf6af218fe7834a060837d4229813de0a.zip chromium_src-073359ddf6af218fe7834a060837d4229813de0a.tar.gz chromium_src-073359ddf6af218fe7834a060837d4229813de0a.tar.bz2 |
Item drag & drop for the OSX app list.
Adds ItemDragController, an NSViewController to manage an item
representation being dragged around the app list, with animations to
grow and shrink the icon similar to the CrOS implementation.
Adds AppsCollectionViewDragManager, a class encapsulating drag-tracking
state that is owned by AppsGridController. It creates NSCollectionViews
that forward mouse events to the manager to allow dragging of items
between pages. Adds functionality to perform hit testing on cells in the
grid, track movement and update the view model, and update the item
model upon release.
BUG=138633
TEST=Added AppsGridControllerTest.{DragAndDropSimple,
DragAndDropMultiPage}. Visuals and fancy scroll gestures, momentum, etc.
tested manually.
Review URL: https://chromiumcodereview.appspot.com/13116005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list/test')
-rw-r--r-- | ui/app_list/test/app_list_test_model.cc | 4 | ||||
-rw-r--r-- | ui/app_list/test/app_list_test_model.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ui/app_list/test/app_list_test_model.cc b/ui/app_list/test/app_list_test_model.cc index 7c5e495..9086fe9 100644 --- a/ui/app_list/test/app_list_test_model.cc +++ b/ui/app_list/test/app_list_test_model.cc @@ -15,6 +15,10 @@ void AppListTestModel::PopulateApps(int n) { AddItem(base::StringPrintf("Item %d", i)); } +void AppListTestModel::PopulateAppWithId(int id) { + AddItem(base::StringPrintf("Item %d", id)); +} + std::string AppListTestModel::GetModelContent() { std::string content; for (size_t i = 0; i < apps()->item_count(); ++i) { diff --git a/ui/app_list/test/app_list_test_model.h b/ui/app_list/test/app_list_test_model.h index 6657a43..75fabf5 100644 --- a/ui/app_list/test/app_list_test_model.h +++ b/ui/app_list/test/app_list_test_model.h @@ -23,6 +23,9 @@ class AppListTestModel : public AppListModel { // Populate the model with |n| items titled "Item #". void PopulateApps(int n); + // Populate the model with an item titled "Item |id|". + void PopulateAppWithId(int id); + // Get a string of all apps in |model| joined with ','. std::string GetModelContent(); |