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

Unified Diff: mojo/services/window_manager/main.cc

Issue 765753003: Move window_manager service implementation to //services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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: mojo/services/window_manager/main.cc
diff --git a/mojo/services/window_manager/main.cc b/mojo/services/window_manager/main.cc
deleted file mode 100644
index 419750be5ec8f3fa9d8dc2d2ef87a5e4a42b0286..0000000000000000000000000000000000000000
--- a/mojo/services/window_manager/main.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 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 "base/memory/scoped_ptr.h"
-#include "mojo/application/application_runner_chromium.h"
-#include "mojo/common/tracing_impl.h"
-#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/service_provider_impl.h"
-#include "mojo/services/public/cpp/view_manager/view_manager.h"
-#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
-#include "mojo/services/window_manager/window_manager_app.h"
-#include "mojo/services/window_manager/window_manager_delegate.h"
-
-// ApplicationDelegate implementation file for WindowManager users (e.g.
-// core window manager tests) that do not want to provide their own
-// ApplicationDelegate::Create().
-
-namespace mojo {
-
-class DefaultWindowManager : public ApplicationDelegate,
- public ViewManagerDelegate,
- public WindowManagerDelegate {
- public:
- DefaultWindowManager()
- : window_manager_app_(new WindowManagerApp(this, this)),
- view_manager_(NULL),
- root_(NULL) {}
- ~DefaultWindowManager() override {}
-
- private:
- // Overridden from ApplicationDelegate:
- void Initialize(ApplicationImpl* impl) override {
- window_manager_app_->Initialize(impl);
- TracingImpl::Create(impl);
- }
- bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
- window_manager_app_->ConfigureIncomingConnection(connection);
- return true;
- }
-
- // Overridden from ViewManagerDelegate:
- void OnEmbed(ViewManager* view_manager,
- View* root,
- ServiceProviderImpl* exported_services,
- scoped_ptr<ServiceProvider> imported_services) override {
- view_manager_ = view_manager;
- root_ = root;
- }
- void OnViewManagerDisconnected(ViewManager* view_manager) override {}
-
- // Overridden from WindowManagerDelegate:
- void Embed(const String& url,
- InterfaceRequest<ServiceProvider> service_provider) override {
- View* view = View::Create(view_manager_);
- root_->AddChild(view);
- view->SetVisible(true);
- view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>(
- new mojo::ServiceProviderImpl).Pass());
- }
-
- scoped_ptr<WindowManagerApp> window_manager_app_;
-
- ViewManager* view_manager_;
- View* root_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager);
-};
-
-} // namespace mojo
-
-MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new mojo::DefaultWindowManager);
- return runner.Run(shell_handle);
-}
« no previous file with comments | « mojo/services/window_manager/focus_rules.h ('k') | mojo/services/window_manager/native_viewport_event_dispatcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698