forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* This will allow a client to create & destroy a container with specific z order, without relying on the order it is created. (will be used for login/lock screen) * Changed to single click to open home card, instead of double click because it's easier and consistent with ash. (ash uses single click to open/activate things) * I tried to add check but I couldn't come up with good solution using window oberver as the child is always added to the top first. BUG=394121 Review URL: https://codereview.chromium.org/411543006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285185 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
oshima@chromium.org
committed
Jul 24, 2014
1 parent
3fdee23
commit 1b9697d
Showing
10 changed files
with
161 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ATHENA_COMMON_CONTAINER_PRIORITIES_H_ | ||
#define ATHENA_COMMON_CONTAINER_PRIORITIES_H_ | ||
|
||
namespace athena { | ||
|
||
enum ContainerPriorities { | ||
CP_BACKGROUND = 0, | ||
CP_DEFAULT, | ||
CP_HOME_CARD, | ||
CP_VIRTUAL_KEYBOARD, | ||
CP_DEBUG, | ||
}; | ||
|
||
} // namespace athena | ||
|
||
#endif // ATHENA_COMMON_CONTAINER_PRIORITIES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "athena/screen/public/screen_manager.h" | ||
|
||
#include <string> | ||
|
||
#include "athena/test/athena_test_base.h" | ||
#include "ui/aura/window.h" | ||
|
||
typedef athena::test::AthenaTestBase ScreenManagerTest; | ||
|
||
namespace athena { | ||
namespace { | ||
|
||
aura::Window* Create(const std::string& name, int z_order_priority) { | ||
ScreenManager::ContainerParams params(name, z_order_priority); | ||
return ScreenManager::Get()->CreateContainer(params); | ||
} | ||
|
||
void CheckZOrder(aura::Window* w1, aura::Window* w2) { | ||
aura::Window* parent = w1->parent(); | ||
const aura::Window::Windows& children = parent->children(); | ||
aura::Window::Windows::const_iterator begin_iter = children.begin(); | ||
aura::Window::Windows::const_iterator end_iter = children.end(); | ||
|
||
aura::Window::Windows::const_iterator w1_iter = | ||
std::find(begin_iter, end_iter, w1); | ||
aura::Window::Windows::const_iterator w2_iter = | ||
std::find(begin_iter, end_iter, w2); | ||
EXPECT_NE(end_iter, w1_iter); | ||
EXPECT_NE(end_iter, w2_iter); | ||
EXPECT_TRUE(w1_iter < w2_iter); | ||
} | ||
|
||
} // namespace | ||
|
||
TEST_F(ScreenManagerTest, Zorder) { | ||
aura::Window* window_10 = Create("test10", 10); | ||
aura::Window* window_11 = Create("test11", 11); | ||
aura::Window* window_12 = Create("test12", 12); | ||
|
||
{ | ||
SCOPED_TRACE("Init"); | ||
CheckZOrder(window_10, window_11); | ||
CheckZOrder(window_11, window_12); | ||
} | ||
{ | ||
SCOPED_TRACE("Delete"); | ||
delete window_11; | ||
CheckZOrder(window_10, window_12); | ||
} | ||
{ | ||
SCOPED_TRACE("Insert"); | ||
window_11 = Create("test11", 11); | ||
CheckZOrder(window_10, window_11); | ||
CheckZOrder(window_11, window_12); | ||
} | ||
} | ||
|
||
} // namespace athena |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters