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

Unified Diff: ash/test/ash_test_base.cc

Issue 1114383002: Show overview mode button in TouchView with open modal window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use SetBoundsInScreen() Created 5 years, 7 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 | « ash/test/ash_test_base.h ('k') | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index ffb633060175ed876faa1c937714d505b0de8441..0a2faf9f1bee3f429ebb022e6404532bf65428c6 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -274,9 +274,7 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
Shell::GetScreen()->GetDisplayMatching(bounds);
aura::Window* root = ash::Shell::GetInstance()->display_controller()->
GetRootWindowForDisplayId(display.id());
- gfx::Point origin = bounds.origin();
- ::wm::ConvertPointFromScreen(root, &origin);
- window->SetBounds(gfx::Rect(origin, bounds.size()));
+ window->SetBoundsInScreen(bounds, Shell::GetScreen()->GetPrimaryDisplay());
aura::client::ParentWindowWithContext(window, root, bounds);
}
window->SetProperty(aura::client::kCanMaximizeKey, true);
@@ -284,6 +282,40 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
return window;
}
+aura::Window* AshTestBase::CreateTestModalWindowInShellWithBounds(
+ const gfx::Rect& bounds) {
+ return CreateTestModalWindowInShellWithDelegateAndType(
+ nullptr, ui::wm::WINDOW_TYPE_NORMAL, 0, bounds);
+}
+
+aura::Window* AshTestBase::CreateTestModalWindowInShellWithDelegateAndType(
+ aura::WindowDelegate* delegate,
+ ui::wm::WindowType type,
+ int id,
+ const gfx::Rect& bounds) {
+ aura::Window* window = new aura::Window(delegate);
+
+ // Note that the system modal property must be set on |window| prior to
+ // calling ParentWindowWithContext(), otherwise it will not be attached
+ // as a descendant of the modal container window.
+ window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM);
+ window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
+ window->Init(ui::LAYER_TEXTURED);
+ window->Show();
+
+ if (bounds.IsEmpty()) {
+ ParentWindowInPrimaryRootWindow(window);
+ } else {
+ gfx::Display display = Shell::GetScreen()->GetDisplayMatching(bounds);
+ aura::Window* root = ash::Shell::GetInstance()
+ ->display_controller()
+ ->GetRootWindowForDisplayId(display.id());
+ window->SetBoundsInScreen(bounds, Shell::GetScreen()->GetPrimaryDisplay());
+ aura::client::ParentWindowWithContext(window, root, bounds);
+ }
+ return window;
+}
+
void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) {
aura::client::ParentWindowWithContext(
window, Shell::GetPrimaryRootWindow(), gfx::Rect());
« no previous file with comments | « ash/test/ash_test_base.h ('k') | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698