diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 21:40:35 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 21:40:35 +0000 |
commit | a2e6af1853d23b82a87b4ae6554424cc6e5393fb (patch) | |
tree | ce0517e27e276e014f7cbec6ecc662c6f064a83d /ash/shell | |
parent | 7a97aa864a3f602b4c032d3088df79528d69454f (diff) | |
download | chromium_src-a2e6af1853d23b82a87b4ae6554424cc6e5393fb.zip chromium_src-a2e6af1853d23b82a87b4ae6554424cc6e5393fb.tar.gz chromium_src-a2e6af1853d23b82a87b4ae6554424cc6e5393fb.tar.bz2 |
Continue threading context through unit tests.
- views_unittest now passes with the assert that checks that we have context.
- ash_unittest...is making progress towards that and this patch is already big.
BUG=161882
Review URL: https://codereview.chromium.org/11795004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell')
-rw-r--r-- | ash/shell/toplevel_window.cc | 15 | ||||
-rw-r--r-- | ash/shell/window_type_launcher.cc | 3 |
2 files changed, 14 insertions, 4 deletions
diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc index cb5f301..2a104bb 100644 --- a/ash/shell/toplevel_window.cc +++ b/ash/shell/toplevel_window.cc @@ -4,8 +4,12 @@ #include "ash/shell/toplevel_window.h" +#include "ash/display/display_controller.h" +#include "ash/display/display_manager.h" +#include "ash/shell.h" #include "ash/wm/property_util.h" #include "base/utf_string_conversions.h" +#include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/gfx/canvas.h" #include "ui/views/widget/widget.h" @@ -24,9 +28,14 @@ void ToplevelWindow::CreateToplevelWindow(const CreateParams& params) { static int count = 0; int x = count == 0 ? 150 : 750; count = (count + 1) % 2; - views::Widget* widget = - views::Widget::CreateWindowWithBounds(new ToplevelWindow(params), - gfx::Rect(x, 150, 300, 300)); + + gfx::Rect bounds(x, 150, 300, 300); + gfx::Display display = + ash::Shell::GetInstance()->display_manager()->GetDisplayMatching(bounds); + aura::RootWindow* root = ash::Shell::GetInstance()->display_controller()-> + GetRootWindowForDisplayId(display.id()); + views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( + new ToplevelWindow(params), root, bounds); widget->GetNativeView()->SetName("Examples:ToplevelWindow"); if (params.persist_across_all_workspaces) { SetPersistsAcrossAllWorkspaces( diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc index c8d34dd..448a3d1 100644 --- a/ash/shell/window_type_launcher.cc +++ b/ash/shell/window_type_launcher.cc @@ -322,7 +322,8 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender, ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(), ui::MODAL_TYPE_WINDOW); } else if (sender == child_modal_button_) { - views::test::CreateChildModalParent(); + views::test::CreateChildModalParent( + GetWidget()->GetNativeView()->GetRootWindow()); } else if (sender == transient_button_) { NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView()); } else if (sender == show_hide_window_button_) { |