diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 21:02:59 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 21:02:59 +0000 |
commit | 87b0d82e3a7323306b3a5b7c94a01226ab601254 (patch) | |
tree | 54f9d25c8e9e71ba1fb2bdbbfad23d7e94f46190 /ui/aura_shell/launcher | |
parent | 39944f52a7d6495574b27443f9d935a76c5d488a (diff) | |
download | chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.zip chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.tar.gz chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.tar.bz2 |
Changes the way windows are parented when their parent is set to NULL.. Adds a DesktopDelegate interface implemented by the aura client. The implementor handles parenting of windows when their parent is set to NULL, and also figures out how to activate windows.. Replaces Desktop::default_parent() with this. Requires adjusting some of the tests and adding a TestDesktopDelegate implementation that reconstructs what default_parent did.BUG=noneTEST=existing unit tests
Review URL: http://codereview.chromium.org/8194004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura_shell/launcher')
-rw-r--r-- | ui/aura_shell/launcher/launcher_view.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ui/aura_shell/launcher/launcher_view.cc b/ui/aura_shell/launcher/launcher_view.cc index 4bc81c5..c685ae1 100644 --- a/ui/aura_shell/launcher/launcher_view.cc +++ b/ui/aura_shell/launcher/launcher_view.cc @@ -8,6 +8,7 @@ #include "ui/aura/desktop.h" #include "ui/aura_shell/aura_shell_export.h" #include "ui/aura_shell/launcher/launcher_button.h" +#include "ui/aura_shell/shell_window_ids.h" #include "ui/gfx/canvas.h" #include "ui/gfx/compositor/layer.h" #include "views/widget/widget.h" @@ -36,13 +37,15 @@ void LauncherView::ButtonPressed(views::Button* sender, const views::Event& event) { } -AURA_SHELL_EXPORT views::Widget* CreateLauncher() { +views::Widget* CreateLauncher() { views::Widget* launcher_widget = new views::Widget; - views::Widget::InitParams params2(views::Widget::InitParams::TYPE_CONTROL); - params2.bounds = gfx::Rect(0, 0, 300, 64); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); + params.bounds = gfx::Rect(0, 0, 300, 64); + params.parent = aura::Desktop::GetInstance()->window()->GetChildById( + aura_shell::internal::kShellWindowId_LauncherContainer); LauncherView* launcher_view = new LauncherView; - params2.delegate = launcher_view; - launcher_widget->Init(params2); + params.delegate = launcher_view; + launcher_widget->Init(params); launcher_widget->GetNativeWindow()->layer()->SetOpacity(0.2f); launcher_widget->SetContentsView(launcher_view); launcher_widget->Show(); |