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

Unified Diff: mash/shelf/shelf_application.cc

Issue 1576683002: Add rudimentary mash shelf functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 11 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 | « mash/shelf/shelf_application.h ('k') | mash/shelf/shelf_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/shelf/shelf_application.cc
diff --git a/mash/shelf/shelf_application.cc b/mash/shelf/shelf_application.cc
new file mode 100644
index 0000000000000000000000000000000000000000..46569780467e2bb475a57cee8a7fc0f035f9e4b4
--- /dev/null
+++ b/mash/shelf/shelf_application.cc
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mash/shelf/shelf_application.h"
+
+#include <stdint.h>
+
+#include "components/mus/public/cpp/property_type_converters.h"
+#include "mash/shelf/shelf_view.h"
+#include "mash/wm/public/interfaces/container.mojom.h"
+#include "mojo/shell/public/cpp/application_impl.h"
+#include "ui/views/mus/aura_init.h"
+#include "ui/views/mus/native_widget_mus.h"
+#include "ui/views/mus/window_manager_connection.h"
+
+namespace mash {
+namespace shelf {
+
+ShelfApplication::ShelfApplication() {}
+
+ShelfApplication::~ShelfApplication() {}
+
+void ShelfApplication::Initialize(mojo::ApplicationImpl* app) {
+ tracing_.Initialize(app);
+
+ aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak"));
+ views::WindowManagerConnection::Create(app);
+
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+ params.delegate = new ShelfView(app);
+
+ std::map<std::string, std::vector<uint8_t>> properties;
+ properties[mash::wm::mojom::kWindowContainer_Property] =
+ mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
+ mash::wm::mojom::CONTAINER_USER_SHELF);
+ mus::Window* window =
+ views::WindowManagerConnection::Get()->NewWindow(properties);
+ params.native_widget = new views::NativeWidgetMus(
+ widget, app->shell(), window, mus::mojom::SURFACE_TYPE_DEFAULT);
+ widget->Init(params);
+ widget->Show();
+}
+
+bool ShelfApplication::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ return true;
+}
+
+} // namespace shelf
+} // namespace mash
« no previous file with comments | « mash/shelf/shelf_application.h ('k') | mash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698