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

Unified Diff: mash/quick_launch/quick_launch.cc

Issue 2915223002: mash: Fix mash app shelf items; encapsulate ash property setup. (Closed)
Patch Set: Similar changes for other mash apps. Created 3 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
Index: mash/quick_launch/quick_launch.cc
diff --git a/mash/quick_launch/quick_launch.cc b/mash/quick_launch/quick_launch.cc
index cd784e66d4c5256deecc51fd6bde82c15f22f551..ffcf13264008a6e9889baa41df2daa64f0d4ef25 100644
--- a/mash/quick_launch/quick_launch.cc
+++ b/mash/quick_launch/quick_launch.cc
@@ -4,6 +4,8 @@
#include "mash/quick_launch/quick_launch.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"
@@ -20,7 +22,6 @@
#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_runner.h"
#include "ui/aura/window.h"
-#include "ui/aura/window_tree_host.h"
#include "ui/views/background.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/textfield/textfield_controller.h"
@@ -174,7 +175,7 @@ void QuickLaunch::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();
Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW);
}
@@ -196,12 +197,17 @@ void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) {
catalog::mojom::CatalogPtr catalog;
context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog);
- views::Widget* window = views::Widget::CreateWindowWithContextAndBounds(
+ views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
new QuickLaunchUI(this, context()->connector(), std::move(catalog)),
nullptr, gfx::Rect(10, 640, 0, 0));
- window->GetNativeWindow()->GetHost()->window()->SetName("QuickLaunch");
- window->Show();
- windows_.push_back(window);
+ aura::Window* window = widget->GetNativeWindow();
+ window->SetName("QuickLaunch");
+ const ash::ShelfID shelf_id("org.chromium.mash.quick_launch");
+ 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 QuickLaunch::Create(const service_manager::BindSourceInfo& source_info,

Powered by Google App Engine
This is Rietveld 408576698