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

Unified Diff: mash/shelf/shelf_application.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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_model.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
index ce67edc42925f141c4d1a4b66a24b0348b9c68e0..fd24dbe4624a6b1ca8b1b3bd81178bbd99c506c8 100644
--- a/mash/shelf/shelf_application.cc
+++ b/mash/shelf/shelf_application.cc
@@ -9,7 +9,7 @@
#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 "mojo/shell/public/cpp/shell.h"
#include "ui/views/mus/aura_init.h"
#include "ui/views/mus/native_widget_mus.h"
#include "ui/views/mus/window_manager_connection.h"
@@ -21,11 +21,13 @@ ShelfApplication::ShelfApplication() {}
ShelfApplication::~ShelfApplication() {}
-void ShelfApplication::Initialize(mojo::ApplicationImpl* app) {
- tracing_.Initialize(app);
+void ShelfApplication::Initialize(mojo::Shell* shell,
+ const std::string& url,
+ uint32_t id) {
+ tracing_.Initialize(shell, url);
- aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak"));
- views::WindowManagerConnection::Create(app);
+ aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak"));
+ views::WindowManagerConnection::Create(shell);
// Construct the shelf using a container tagged for positioning by the WM.
views::Widget* widget = new views::Widget;
@@ -38,18 +40,13 @@ void ShelfApplication::Initialize(mojo::ApplicationImpl* app) {
mus::Window* window =
views::WindowManagerConnection::Get()->NewWindow(properties);
params.native_widget = new views::NativeWidgetMus(
- widget, app->shell(), window, mus::mojom::SurfaceType::DEFAULT);
+ widget, shell, window, mus::mojom::SurfaceType::DEFAULT);
widget->Init(params);
- widget->SetContentsView(new ShelfView(app));
+ widget->SetContentsView(new ShelfView(shell));
// Call CenterWindow to mimic Widget::Init's placement with a widget delegate.
widget->CenterWindow(widget->GetContentsView()->GetPreferredSize());
widget->Show();
}
-bool ShelfApplication::AcceptConnection(
- mojo::ApplicationConnection* connection) {
- return true;
-}
-
} // namespace shelf
} // namespace mash
« no previous file with comments | « mash/shelf/shelf_application.h ('k') | mash/shelf/shelf_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698