Chromium Code Reviews| Index: mash/example/window_type_launcher/window_type_launcher.cc |
| diff --git a/mash/example/window_type_launcher/window_type_launcher.cc b/mash/example/window_type_launcher/window_type_launcher.cc |
| index 558a42c13d2f75c7c016f439470e8f4ae393d505..3614221b0716605861b725c389869ff29ef07101 100644 |
| --- a/mash/example/window_type_launcher/window_type_launcher.cc |
| +++ b/mash/example/window_type_launcher/window_type_launcher.cc |
| @@ -6,6 +6,8 @@ |
| #include <stdint.h> |
| +#include "ash/public/cpp/shelf_types.h" |
| +#include "ash/public/cpp/window_properties.h" |
| #include "base/macros.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/message_loop/message_loop.h" |
| @@ -456,6 +458,7 @@ void WindowTypeLauncher::OnStart() { |
| aura_init_ = base::MakeUnique<views::AuraInit>( |
| context()->connector(), context()->identity(), "views_mus_resources.pak", |
| std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); |
| + ash::RegisterWindowPropertiesForTransportAndMirroring(); |
| } |
| void WindowTypeLauncher::OnBindInterface( |
| @@ -473,12 +476,17 @@ void WindowTypeLauncher::Launch(uint32_t what, mash::mojom::LaunchMode how) { |
| windows_.back()->Activate(); |
| return; |
| } |
| - views::Widget* window = new views::Widget; |
| + views::Widget* widget = new views::Widget; |
| views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| params.delegate = new WindowTypeLauncherView(this, context()->connector()); |
| - window->Init(params); |
| - window->Show(); |
| - windows_.push_back(window); |
| + widget->Init(params); |
| + aura::Window* window = widget->GetNativeWindow(); |
| + const ash::ShelfID shelf_id("org.chromium.mash.window_type_launcher"); |
|
msw
2017/06/01 23:35:41
q: I can't actually launch this from chrome --mash
|
| + window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize())); |
| + window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); |
| + |
| + widget->Show(); |
| + windows_.push_back(widget); |
| } |
| void WindowTypeLauncher::Create( |