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

Unified Diff: components/view_manager/view_manager_app.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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 | « components/view_manager/view_manager_app.h ('k') | components/view_manager/view_manager_client_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/view_manager/view_manager_app.cc
diff --git a/components/view_manager/view_manager_app.cc b/components/view_manager/view_manager_app.cc
deleted file mode 100644
index 922fdacf2178a6a4ec72d7c163cdc10d1eca74e2..0000000000000000000000000000000000000000
--- a/components/view_manager/view_manager_app.cc
+++ /dev/null
@@ -1,149 +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 "components/view_manager/view_manager_app.h"
-
-#include "base/command_line.h"
-#include "base/stl_util.h"
-#include "components/view_manager/client_connection.h"
-#include "components/view_manager/connection_manager.h"
-#include "components/view_manager/gles2/gpu_impl.h"
-#include "components/view_manager/public/cpp/args.h"
-#include "components/view_manager/surfaces/surfaces_scheduler.h"
-#include "components/view_manager/view_tree_host_connection.h"
-#include "components/view_manager/view_tree_host_impl.h"
-#include "components/view_manager/view_tree_impl.h"
-#include "mojo/application/public/cpp/application_connection.h"
-#include "mojo/application/public/cpp/application_impl.h"
-#include "mojo/application/public/cpp/application_runner.h"
-#include "mojo/common/tracing_impl.h"
-#include "third_party/mojo/src/mojo/public/c/system/main.h"
-#include "ui/events/event_switches.h"
-#include "ui/events/platform/platform_event_source.h"
-#include "ui/gl/gl_surface.h"
-#include "ui/gl/test/gl_surface_test_support.h"
-
-#if defined(USE_X11)
-#include <X11/Xlib.h>
-#include "ui/platform_window/x11/x11_window.h"
-#endif
-
-using mojo::ApplicationConnection;
-using mojo::ApplicationImpl;
-using mojo::Gpu;
-using mojo::InterfaceRequest;
-using mojo::ViewTreeHostFactory;
-
-namespace view_manager {
-
-ViewManagerApp::ViewManagerApp()
- : app_impl_(nullptr),
- is_headless_(false) {
-}
-
-ViewManagerApp::~ViewManagerApp() {
- if (gpu_state_)
- gpu_state_->StopControlThread();
- // Destroy |connection_manager_| first, since it depends on |event_source_|.
- connection_manager_.reset();
-}
-
-void ViewManagerApp::Initialize(ApplicationImpl* app) {
- app_impl_ = app;
- tracing_.Initialize(app);
- surfaces_state_ = new surfaces::SurfacesState;
-
-#if !defined(OS_ANDROID)
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig);
- if (!is_headless_) {
-#if defined(USE_X11)
- if (command_line->HasSwitch(mojo::kUseX11TestConfig)) {
- XInitThreads();
- ui::test::SetUseOverrideRedirectWindowByDefault(true);
- }
-#endif
- gfx::GLSurface::InitializeOneOff();
- event_source_ = ui::PlatformEventSource::CreateDefault();
- }
-#endif
-
- if (!gpu_state_.get())
- gpu_state_ = new gles2::GpuState;
- connection_manager_.reset(new ConnectionManager(this, surfaces_state_));
-}
-
-bool ViewManagerApp::ConfigureIncomingConnection(
- ApplicationConnection* connection) {
- // ViewManager
- connection->AddService<ViewTreeHostFactory>(this);
- // GPU
- connection->AddService<Gpu>(this);
- return true;
-}
-
-void ViewManagerApp::OnNoMoreRootConnections() {
- app_impl_->Quit();
-}
-
-ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView(
- ConnectionManager* connection_manager,
- mojo::InterfaceRequest<mojo::ViewTree> tree_request,
- mojo::ConnectionSpecificId creator_id,
- mojo::URLRequestPtr request,
- const ViewId& root_id) {
- mojo::ViewTreeClientPtr client;
- app_impl_->ConnectToService(request.Pass(), &client);
-
- scoped_ptr<ViewTreeImpl> service(
- new ViewTreeImpl(connection_manager, creator_id, root_id));
- return new DefaultClientConnection(service.Pass(), connection_manager,
- tree_request.Pass(), client.Pass());
-}
-
-ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView(
- ConnectionManager* connection_manager,
- mojo::InterfaceRequest<mojo::ViewTree> tree_request,
- mojo::ConnectionSpecificId creator_id,
- const ViewId& root_id,
- mojo::ViewTreeClientPtr client) {
- scoped_ptr<ViewTreeImpl> service(
- new ViewTreeImpl(connection_manager, creator_id, root_id));
- return new DefaultClientConnection(service.Pass(), connection_manager,
- tree_request.Pass(),
- client.Pass());
-}
-
-void ViewManagerApp::Create(ApplicationConnection* connection,
- InterfaceRequest<ViewTreeHostFactory> request) {
- factory_bindings_.AddBinding(this, request.Pass());
-}
-
-void ViewManagerApp::Create(
- mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<Gpu> request) {
- if (!gpu_state_.get())
- gpu_state_ = new gles2::GpuState;
- new gles2::GpuImpl(request.Pass(), gpu_state_);
-}
-
-void ViewManagerApp::CreateViewTreeHost(
- mojo::InterfaceRequest<mojo::ViewTreeHost> host,
- mojo::ViewTreeHostClientPtr host_client,
- mojo::ViewTreeClientPtr tree_client) {
- DCHECK(connection_manager_.get());
-
- // TODO(fsamuel): We need to make sure that only the window manager can create
- // new roots.
- ViewTreeHostImpl* host_impl = new ViewTreeHostImpl(
- host_client.Pass(), connection_manager_.get(), is_headless_, app_impl_,
- gpu_state_, surfaces_state_);
-
- // ViewTreeHostConnection manages its own lifetime.
- host_impl->Init(new ViewTreeHostConnectionImpl(
- host.Pass(), make_scoped_ptr(host_impl), tree_client.Pass(),
- connection_manager_.get()));
-}
-
-} // namespace view_manager
« no previous file with comments | « components/view_manager/view_manager_app.h ('k') | components/view_manager/view_manager_client_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698