Commit b33072f3 authored by skuhne@chromium.org's avatar skuhne@chromium.org

Don't allow windowed but not pinned applications to mix with shortcuts in the shelf launcher

At the moment running windowed applications can be mixed with pinned applications - which is incorrect (checked with kuscher).

This CL is a pre-CL for the order preservation of all running applications in multi profile mode (trying to keep it small).

BUG=309029
TEST=unit test

Review URL: https://codereview.chromium.org/133743005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244416 0039d316-1c4b-4281-b951-d872f2087c98
parent 853fc827
......@@ -22,8 +22,8 @@ int LauncherItemTypeToWeight(LauncherItemType type) {
return 0;
case TYPE_BROWSER_SHORTCUT:
case TYPE_APP_SHORTCUT:
case TYPE_WINDOWED_APP:
return 1;
case TYPE_WINDOWED_APP:
case TYPE_PLATFORM_APP:
return 2;
case TYPE_DIALOG:
......@@ -38,8 +38,8 @@ int LauncherItemTypeToWeight(LauncherItemType type) {
switch (type) {
case TYPE_BROWSER_SHORTCUT:
case TYPE_APP_SHORTCUT:
case TYPE_WINDOWED_APP:
return 0;
case TYPE_WINDOWED_APP:
case TYPE_PLATFORM_APP:
return 1;
case TYPE_APP_LIST:
......
......@@ -1756,18 +1756,15 @@ TEST_F(ChromeLauncherControllerTest, RestoreDefaultAndLockedAppsResyncOrder) {
// Going back to a status where there is no requirement for app 2 to be pinned
// should convert it back to locked but not pinned and state. The position
// is determined by the |ShelfModel|'s weight system. Since at the moment
// the weight of a running app has the same as a shortcut, it will remain
// where it is. Surely note ideal, but since the sync process can shift around
// locations - as well as many other edge cases - this gets nearly impossible
// to get right.
// TODO(skuhne): Filed crbug.com/293761 to track of this.
// is determined by the |ShelfModel|'s weight system and since running
// applications are not allowed to be mixed with shortcuts, it should show up
// at the end of the list.
base::ListValue policy_value2;
InsertPrefValue(&policy_value2, 0, extension3_->id());
InsertPrefValue(&policy_value2, 1, extension1_->id());
profile()->GetTestingPrefService()->SetUserPref(prefs::kPinnedLauncherApps,
policy_value2.DeepCopy());
EXPECT_EQ("AppList, Chrome, App3, app2, App1, ", GetPinnedAppStatus());
EXPECT_EQ("AppList, Chrome, App3, App1, app2, ", GetPinnedAppStatus());
// Removing an item should simply close it and everything should shift.
base::ListValue policy_value3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment