summaryrefslogtreecommitdiffstats
path: root/third_party/mojo_services
diff options
context:
space:
mode:
authorviettrungluu <viettrungluu@chromium.org>2015-02-06 15:46:09 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-06 23:46:46 +0000
commit0e5adf14aee00d99270cfe780a4364474e952912 (patch)
tree9ab71fc068fd1e1dc5909ef0a9dae11ec6b79072 /third_party/mojo_services
parentaccbfa1e86e32df669fad209185cba4acd6847be (diff)
downloadchromium_src-0e5adf14aee00d99270cfe780a4364474e952912.zip
chromium_src-0e5adf14aee00d99270cfe780a4364474e952912.tar.gz
chromium_src-0e5adf14aee00d99270cfe780a4364474e952912.tar.bz2
Revert "Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0"
This reverts commit c2e11810044fe5ff1c1b8588103671925a5b74fe. TBR=viettrungluu@chromium.org NOTRY=true NOTREECHECKS=true NOPRESUBMIT=true BUG= Review URL: https://codereview.chromium.org/877993004 Cr-Commit-Position: refs/heads/master@{#315134}
Diffstat (limited to 'third_party/mojo_services')
-rw-r--r--third_party/mojo_services/src/geometry/public/cpp/DEPS3
-rw-r--r--third_party/mojo_services/src/gpu/public/interfaces/command_buffer.mojom18
-rw-r--r--third_party/mojo_services/src/native_viewport/public/cpp/DEPS3
-rw-r--r--third_party/mojo_services/src/public/js/application.js42
-rw-r--r--third_party/mojo_services/src/public/js/service_provider.js (renamed from third_party/mojo_services/src/public/js/service_exchange.js)14
-rw-r--r--third_party/mojo_services/src/public/js/shell.js8
-rw-r--r--third_party/mojo_services/src/public/sky/BUILD.gn2
-rw-r--r--third_party/mojo_services/src/surfaces/public/cpp/DEPS4
-rw-r--r--third_party/mojo_services/src/surfaces/public/interfaces/BUILD.gn1
-rw-r--r--third_party/mojo_services/src/surfaces/public/interfaces/surfaces.mojom25
-rw-r--r--third_party/mojo_services/src/surfaces/public/interfaces/surfaces_service.mojom15
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/DEPS14
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/lib/DEPS10
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/lib/view.cc2
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.cc44
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.h21
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/tests/BUILD.gn2
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/tests/DEPS16
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/tests/view_manager_unittests.cc (renamed from third_party/mojo_services/src/view_manager/public/cpp/tests/run_all_unittests.cc)0
-rw-r--r--third_party/mojo_services/src/view_manager/public/cpp/view_observer.h2
-rw-r--r--third_party/mojo_services/src/window_manager/public/interfaces/window_manager.mojom22
21 files changed, 160 insertions, 108 deletions
diff --git a/third_party/mojo_services/src/geometry/public/cpp/DEPS b/third_party/mojo_services/src/geometry/public/cpp/DEPS
new file mode 100644
index 0000000..b413470
--- /dev/null
+++ b/third_party/mojo_services/src/geometry/public/cpp/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+geometry/public/interfaces",
+]
diff --git a/third_party/mojo_services/src/gpu/public/interfaces/command_buffer.mojom b/third_party/mojo_services/src/gpu/public/interfaces/command_buffer.mojom
index aa2c556..a31b3dd 100644
--- a/third_party/mojo_services/src/gpu/public/interfaces/command_buffer.mojom
+++ b/third_party/mojo_services/src/gpu/public/interfaces/command_buffer.mojom
@@ -25,19 +25,10 @@ interface CommandBufferSyncPointClient {
DidInsertSyncPoint(uint32 sync_point);
};
-interface CommandBufferLostContextObserver {
- DidLoseContext(int32 context_lost_reason);
-};
-
+[Client=CommandBufferClient]
interface CommandBuffer {
- // Initialize attempts to initialize the command buffer. Success or failure
- // will be communicated via the CommandBufferSyncClient DidInitialize() call.
- // If the context is lost after creation the LostContext method on the
- // CommandBufferLostContextObserver's will be called then this pipe will be
- // closed.
Initialize(CommandBufferSyncClient sync_client,
CommandBufferSyncPointClient sync_point_client,
- CommandBufferLostContextObserver lost_observer,
handle<shared_buffer> shared_state);
SetGetBuffer(int32 buffer);
Flush(int32 put_offset);
@@ -52,4 +43,11 @@ interface CommandBuffer {
InsertSyncPoint(bool retire);
RetireSyncPoint(uint32 sync_point);
Echo() => ();
+
+ // TODO(piman): sync points
+};
+
+interface CommandBufferClient {
+ DidDestroy();
+ LostContext(int32 lost_reason); // TODO(piman): enum
};
diff --git a/third_party/mojo_services/src/native_viewport/public/cpp/DEPS b/third_party/mojo_services/src/native_viewport/public/cpp/DEPS
new file mode 100644
index 0000000..8fc8a7f
--- /dev/null
+++ b/third_party/mojo_services/src/native_viewport/public/cpp/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+native_viewport/public",
+]
diff --git a/third_party/mojo_services/src/public/js/application.js b/third_party/mojo_services/src/public/js/application.js
index aea60fd..d4aa1e6 100644
--- a/third_party/mojo_services/src/public/js/application.js
+++ b/third_party/mojo_services/src/public/js/application.js
@@ -8,19 +8,20 @@ define("mojo/services/public/js/application", [
"mojo/public/js/connection",
"mojo/public/js/threading",
"mojo/public/interfaces/application/application.mojom",
- "mojo/services/public/js/service_exchange",
+ "mojo/services/public/js/service_provider",
"mojo/services/public/js/shell",
-], function(bindings, core, connection, threading, applicationMojom, serviceExchange, shell) {
+], function(bindings, core, connection, threading, applicationMojom, serviceProvider, shell) {
const ApplicationInterface = applicationMojom.Application;
const ProxyBindings = bindings.ProxyBindings;
- const ServiceExchange = serviceExchange.ServiceExchange;
+ const ServiceProvider = serviceProvider.ServiceProvider;
const Shell = shell.Shell;
class Application {
constructor(appRequestHandle, url) {
this.url = url;
- this.serviceExchanges = [];
+ this.serviceProviders = [];
+ this.exposedServiceProviders = [];
this.appRequestHandle_ = appRequestHandle;
this.appStub_ =
connection.bindHandleToStub(appRequestHandle, ApplicationInterface);
@@ -36,27 +37,30 @@ define("mojo/services/public/js/application", [
this.initialize(args);
}
- initialize(args) {
- }
+ initialize(args) {}
- // Implements AcceptConnection() from Application.mojom. Calls
- // this.acceptConnection() with a JS ServiceExchange instead of a pair
- // of Mojo ServiceProviders.
+ // The mojom signature of this function is:
+ // AcceptConnection(string requestor_url,
+ // ServiceProvider&? services,
+ // ServiceProvider? exposed_services);
+ //
+ // We want to bind |services| to our js implementation of ServiceProvider
+ // and store |exposed_services| so we can request services of the connecting
+ // application.
doAcceptConnection(requestorUrl, servicesRequest, exposedServicesProxy) {
- var serviceExchange =
- new ServiceExchange(servicesRequest, exposedServicesProxy);
- this.serviceExchanges.push(serviceExchange);
- this.acceptConnection(requestorUrl, serviceExchange);
+ // Construct a new js ServiceProvider that can make outgoing calls on
+ // exposedServicesProxy.
+ var serviceProvider =
+ new ServiceProvider(servicesRequest, exposedServicesProxy);
+ this.serviceProviders.push(serviceProvider);
+ this.acceptConnection(requestorUrl, serviceProvider);
}
- // Subclasses override this method to request or provide services for
- // ConnectToApplication() calls from requestorURL.
- acceptConnection(requestorUrl, serviceExchange) {
- }
+ acceptConnection(requestorUrl, serviceProvider) {}
quit() {
- this.serviceExchanges.forEach(function(exch) {
- exch.close();
+ this.serviceProviders.forEach(function(sp) {
+ sp.close();
});
this.shell.close();
core.close(this.appRequestHandle_);
diff --git a/third_party/mojo_services/src/public/js/service_exchange.js b/third_party/mojo_services/src/public/js/service_provider.js
index a424c12..a6a81ca 100644
--- a/third_party/mojo_services/src/public/js/service_exchange.js
+++ b/third_party/mojo_services/src/public/js/service_provider.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-define("mojo/services/public/js/service_exchange", [
+define("mojo/services/public/js/service_provider", [
"mojo/public/js/bindings",
"mojo/public/interfaces/application/service_provider.mojom",
"mojo/public/js/connection",
@@ -12,12 +12,12 @@ define("mojo/services/public/js/service_exchange", [
const StubBindings = bindings.StubBindings;
const ServiceProviderInterface = spMojom.ServiceProvider;
- function checkServiceExchange(exch) {
- if (!exch.providers_)
+ function checkServiceProvider(sp) {
+ if (!sp.providers_)
throw new Error("Service was closed");
}
- class ServiceExchange {
+ class ServiceProvider {
constructor(servicesRequest, exposedServicesProxy) {
this.proxy = exposedServicesProxy;
this.providers_ = new Map(); // serviceName => see provideService() below
@@ -43,7 +43,7 @@ define("mojo/services/public/js/service_exchange", [
}
provideService(service, factory) {
- checkServiceExchange(this);
+ checkServiceProvider(this);
var provider = {
service: service, // A JS bindings interface object.
@@ -61,7 +61,7 @@ define("mojo/services/public/js/service_exchange", [
// Outgoing requests
requestService(interfaceObject, clientImpl) {
- checkServiceExchange(this);
+ checkServiceProvider(this);
if (!interfaceObject.name)
throw new Error("Invalid service parameter");
if (!clientImpl && interfaceObject.client)
@@ -81,6 +81,6 @@ define("mojo/services/public/js/service_exchange", [
}
var exports = {};
- exports.ServiceExchange = ServiceExchange;
+ exports.ServiceProvider = ServiceProvider;
return exports;
});
diff --git a/third_party/mojo_services/src/public/js/shell.js b/third_party/mojo_services/src/public/js/shell.js
index 90b3533..e6c2dee 100644
--- a/third_party/mojo_services/src/public/js/shell.js
+++ b/third_party/mojo_services/src/public/js/shell.js
@@ -8,12 +8,12 @@ define("mojo/services/public/js/shell", [
"mojo/public/js/connection",
"mojo/public/interfaces/application/shell.mojom",
"mojo/public/interfaces/application/service_provider.mojom",
- "mojo/services/public/js/service_exchange",
-], function(bindings, core, connection, shellMojom, spMojom, serviceExchange) {
+ "mojo/services/public/js/service_provider","console",
+], function(bindings, core, connection, shellMojom, spMojom, sp, console) {
const ProxyBindings = bindings.ProxyBindings;
const StubBindings = bindings.StubBindings;
- const ServiceExchange = serviceExchange.ServiceExchange;
+ const ServiceProvider = sp.ServiceProvider;
const ServiceProviderInterface = spMojom.ServiceProvider;
const ShellInterface = shellMojom.Shell;
@@ -28,7 +28,7 @@ define("mojo/services/public/js/shell", [
if (application)
return application;
- var application = new ServiceExchange();
+ var application = new ServiceProvider();
this.shellProxy.connectToApplication(url,
function(services) {
application.proxy = services;
diff --git a/third_party/mojo_services/src/public/sky/BUILD.gn b/third_party/mojo_services/src/public/sky/BUILD.gn
index 2c5c63c..4776aa3 100644
--- a/third_party/mojo_services/src/public/sky/BUILD.gn
+++ b/third_party/mojo_services/src/public/sky/BUILD.gn
@@ -6,7 +6,7 @@ action_foreach("sky") {
script = "../../../public/sky/convert_amd_modules_to_sky.py"
sources = [
"../js/application.js",
- "../js/service_exchange.js",
+ "../js/service_provider.js",
"../js/shell.js",
]
outputs = [
diff --git a/third_party/mojo_services/src/surfaces/public/cpp/DEPS b/third_party/mojo_services/src/surfaces/public/cpp/DEPS
new file mode 100644
index 0000000..bc9750c
--- /dev/null
+++ b/third_party/mojo_services/src/surfaces/public/cpp/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ "+geometry/public/interfaces",
+ "+surfaces/public",
+]
diff --git a/third_party/mojo_services/src/surfaces/public/interfaces/BUILD.gn b/third_party/mojo_services/src/surfaces/public/interfaces/BUILD.gn
index aaab024..76f5172 100644
--- a/third_party/mojo_services/src/surfaces/public/interfaces/BUILD.gn
+++ b/third_party/mojo_services/src/surfaces/public/interfaces/BUILD.gn
@@ -9,6 +9,7 @@ mojom("interfaces") {
sources = [
"quads.mojom",
"surfaces.mojom",
+ "surfaces_service.mojom",
]
import_dirs = [ get_path_info("../../../", "abspath") ]
diff --git a/third_party/mojo_services/src/surfaces/public/interfaces/surfaces.mojom b/third_party/mojo_services/src/surfaces/public/interfaces/surfaces.mojom
index 71aed7e..7badcd3 100644
--- a/third_party/mojo_services/src/surfaces/public/interfaces/surfaces.mojom
+++ b/third_party/mojo_services/src/surfaces/public/interfaces/surfaces.mojom
@@ -52,28 +52,21 @@ struct Frame {
array<Pass> passes;
};
-interface ResourceReturner {
+interface SurfaceClient {
+ // This sets the id namespace for this connection. This method will be invoked
+ // exactly once when a new connection is established.
+ SetIdNamespace(uint32 id_namespace);
ReturnResources(array<ReturnedResource> resources);
};
+[Client=SurfaceClient]
interface Surface {
- // Request the id namespace for this connection. Fully qualified surface ids
- // are the combination of the id_namespace for the connection that created the
- // surface and the id_local component allocated by the caller.
- GetIdNamespace() => (uint32 id_namespace);
-
- // Sets a ResourceReturner that will receive unused resources.
- SetResourceReturner(ResourceReturner returner);
-
- // Creates a new surface with the given local identifier. Once a surface is
- // created the caller may submit frames to it or destroy it using the local
- // identifier. The caller can also produce a fully qualified surface id that
- // can be embedded in frames produces by different connections.
CreateSurface(uint32 id_local);
- // After the submitted frame is drawn for the first time, the surface will
- // respond to the SubmitFrame message. Clients should use this acknowledgement
- // to ratelimit frame submissions.
+ // The client can only submit frames to surfaces created with this
+ // connection. After the submitted frame is drawn for the first time, the
+ // surface will respond to the SubmitFrame message. Clients should use this
+ // acknowledgement to ratelimit frame submissions.
SubmitFrame(uint32 id_local, Frame frame) => ();
DestroySurface(uint32 id_local);
diff --git a/third_party/mojo_services/src/surfaces/public/interfaces/surfaces_service.mojom b/third_party/mojo_services/src/surfaces/public/interfaces/surfaces_service.mojom
new file mode 100644
index 0000000..e1ca690
--- /dev/null
+++ b/third_party/mojo_services/src/surfaces/public/interfaces/surfaces_service.mojom
@@ -0,0 +1,15 @@
+// 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.
+
+module mojo;
+
+import "surfaces/public/interfaces/surfaces.mojom";
+
+// Use this interface to request connections to the surfaces service. Each
+// connection is associated with an id namespace
+interface SurfacesService {
+ // DEPRECATED: Just connect to mojo.Surface directly and receive the id
+ // namespace via SetIdNamespace.
+ CreateSurfaceConnection() => (Surface surface, uint32 id_namespace);
+};
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/DEPS b/third_party/mojo_services/src/view_manager/public/cpp/DEPS
new file mode 100644
index 0000000..c08c2c8
--- /dev/null
+++ b/third_party/mojo_services/src/view_manager/public/cpp/DEPS
@@ -0,0 +1,14 @@
+include_rules = [
+ "+geometry/public",
+ "+input_events/public",
+ "+surfaces/public",
+ "+view_manager/public",
+ "+window_manager/public",
+
+ # TODO(blundell): Eliminate these dependencies. crbug.com/451403
+ "!base/basictypes.h",
+ "!base/bind.h",
+ "!base/compiler_specific.h",
+ "!base/memory/scoped_ptr.h",
+ "!base/observer_list.h",
+]
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/lib/DEPS b/third_party/mojo_services/src/view_manager/public/cpp/lib/DEPS
new file mode 100644
index 0000000..f36ebc7
--- /dev/null
+++ b/third_party/mojo_services/src/view_manager/public/cpp/lib/DEPS
@@ -0,0 +1,10 @@
+include_rules = [
+ "+mojo/services/window_manager/public",
+
+ # TODO(blundell): Eliminate these dependencies. crbug.com/451403
+ "!base/callback.h",
+ "!base/memory/scoped_vector.h",
+ "!base/memory/weak_ptr.h",
+ "!base/message_loop/message_loop.h",
+ "!base/stl_util.h",
+]
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/lib/view.cc b/third_party/mojo_services/src/view_manager/public/cpp/lib/view.cc
index f7e7784..d347292 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/lib/view.cc
+++ b/third_party/mojo_services/src/view_manager/public/cpp/lib/view.cc
@@ -387,7 +387,7 @@ namespace {
ViewportMetricsPtr CreateEmptyViewportMetrics() {
ViewportMetricsPtr metrics = ViewportMetrics::New();
metrics->size = Size::New();
- return metrics;
+ return metrics.Pass();
}
}
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.cc b/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.cc
index eea760b..595e039 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.cc
+++ b/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.cc
@@ -105,7 +105,6 @@ ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate,
capture_view_(nullptr),
focused_view_(nullptr),
activated_view_(nullptr),
- wm_observer_binding_(this),
binding_(this, handle.Pass()),
service_(binding_.client()),
delete_on_error_(delete_on_error) {
@@ -273,12 +272,10 @@ void ViewManagerClientImpl::OnEmbed(
root_->AddObserver(new RootObserver(root_));
window_manager_.Bind(window_manager_pipe.Pass());
+ window_manager_.set_client(this);
// base::Unretained() is safe here as |window_manager_| is bound to our
// lifetime.
- WindowManagerObserverPtr observer;
- wm_observer_binding_.Bind(GetProxy(&observer));
window_manager_->GetFocusedAndActiveViews(
- observer.Pass(),
base::Bind(&ViewManagerClientImpl::OnGotFocusedAndActiveViews,
base::Unretained(this)));
@@ -400,11 +397,12 @@ void ViewManagerClientImpl::OnViewInputEvent(
}
////////////////////////////////////////////////////////////////////////////////
-// ViewManagerClientImpl, WindowManagerObserver implementation:
+// ViewManagerClientImpl, WindowManagerClient implementation:
-void ViewManagerClientImpl::OnCaptureChanged(Id capture_view_id) {
- View* gained_capture = GetViewById(capture_view_id);
- View* lost_capture = capture_view_;
+void ViewManagerClientImpl::OnCaptureChanged(Id old_capture_view_id,
+ Id new_capture_view_id) {
+ View* gained_capture = GetViewById(new_capture_view_id);
+ View* lost_capture = GetViewById(old_capture_view_id);
if (lost_capture) {
FOR_EACH_OBSERVER(ViewObserver,
*ViewPrivate(lost_capture).observers(),
@@ -418,9 +416,10 @@ void ViewManagerClientImpl::OnCaptureChanged(Id capture_view_id) {
}
}
-void ViewManagerClientImpl::OnFocusChanged(Id focused_view_id) {
- View* focused = GetViewById(focused_view_id);
- View* blurred = focused_view_;
+void ViewManagerClientImpl::OnFocusChanged(Id old_focused_view_id,
+ Id new_focused_view_id) {
+ View* focused = GetViewById(new_focused_view_id);
+ View* blurred = GetViewById(old_focused_view_id);
if (blurred) {
FOR_EACH_OBSERVER(ViewObserver,
*ViewPrivate(blurred).observers(),
@@ -434,9 +433,10 @@ void ViewManagerClientImpl::OnFocusChanged(Id focused_view_id) {
}
}
-void ViewManagerClientImpl::OnActiveWindowChanged(Id active_view_id) {
- View* activated = GetViewById(active_view_id);
- View* deactivated = activated_view_;
+void ViewManagerClientImpl::OnActiveWindowChanged(Id old_active_view_id,
+ Id new_active_view_id) {
+ View* activated = GetViewById(new_active_view_id);
+ View* deactivated = GetViewById(old_active_view_id);
if (deactivated) {
FOR_EACH_OBSERVER(ViewObserver,
*ViewPrivate(deactivated).observers(),
@@ -485,16 +485,14 @@ base::Callback<void(ErrorCode)>
base::Unretained(this));
}
-void ViewManagerClientImpl::OnGotFocusedAndActiveViews(
- uint32_t capture_view_id,
- uint32_t focused_view_id,
- uint32_t active_view_id) {
- if (GetViewById(capture_view_id) != capture_view_)
- OnCaptureChanged(capture_view_id);
+void ViewManagerClientImpl::OnGotFocusedAndActiveViews(uint32 focused_view_id,
+ uint32 active_view_id) {
if (GetViewById(focused_view_id) != focused_view_)
- OnFocusChanged(focused_view_id);
- if (GetViewById(active_view_id) != activated_view_)
- OnActiveWindowChanged(active_view_id);
+ OnFocusChanged(focused_view_ ? focused_view_->id() : 0, focused_view_id);
+ if (GetViewById(active_view_id) != activated_view_) {
+ OnActiveWindowChanged(activated_view_ ? activated_view_->id() : 0,
+ active_view_id);
+ }
}
} // namespace mojo
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.h b/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.h
index e0d7bba..2405229 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.h
+++ b/third_party/mojo_services/src/view_manager/public/cpp/lib/view_manager_client_impl.h
@@ -5,6 +5,7 @@
#ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_
#define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_
+#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
@@ -24,7 +25,7 @@ class ViewManagerTransaction;
// Manages the connection with the View Manager service.
class ViewManagerClientImpl : public ViewManager,
public ViewManagerClient,
- public WindowManagerObserver,
+ public WindowManagerClient,
public ErrorHandler {
public:
ViewManagerClientImpl(ViewManagerDelegate* delegate,
@@ -121,10 +122,12 @@ class ViewManagerClientImpl : public ViewManager,
EventPtr event,
const Callback<void()>& callback) override;
- // Overridden from WindowManagerObserver:
- void OnCaptureChanged(Id capture_view_id) override;
- void OnFocusChanged(Id focused_view_id) override;
- void OnActiveWindowChanged(Id focused_view_id) override;
+ // Overridden from WindowManagerClient:
+ void OnCaptureChanged(Id old_capture_view_id,
+ Id new_capture_view_id) override;
+ void OnFocusChanged(Id old_focused_view_id, Id new_focused_view_id) override;
+ void OnActiveWindowChanged(Id old_focused_view_id,
+ Id new_focused_view_id) override;
// ErrorHandler implementation.
void OnConnectionError() override;
@@ -137,10 +140,9 @@ class ViewManagerClientImpl : public ViewManager,
base::Callback<void(bool)> ActionCompletedCallback();
base::Callback<void(ErrorCode)> ActionCompletedCallbackWithErrorCode();
- // Callback from server for initial request of capture/focused/active views.
- void OnGotFocusedAndActiveViews(uint32_t capture_view_id,
- uint32_t focused_view_id,
- uint32_t active_view_id);
+ // Callback from server for initial request of focused/active views.
+ void OnGotFocusedAndActiveViews(uint32 focused_view_id,
+ uint32 active_view_id);
bool connected_;
ConnectionSpecificId connection_id_;
@@ -161,7 +163,6 @@ class ViewManagerClientImpl : public ViewManager,
View* activated_view_;
WindowManagerPtr window_manager_;
- Binding<WindowManagerObserver> wm_observer_binding_;
Binding<ViewManagerClient> binding_;
ViewManagerService* service_;
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/tests/BUILD.gn b/third_party/mojo_services/src/view_manager/public/cpp/tests/BUILD.gn
index 3414d33..e912084 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/tests/BUILD.gn
+++ b/third_party/mojo_services/src/view_manager/public/cpp/tests/BUILD.gn
@@ -7,10 +7,10 @@ import("//testing/test.gni")
test("mojo_view_manager_lib_unittests") {
sources = [
- "run_all_unittests.cc",
"view_manager_test_suite.cc",
"view_manager_test_suite.h",
"view_manager_unittest.cc",
+ "view_manager_unittests.cc",
"view_unittest.cc",
]
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/tests/DEPS b/third_party/mojo_services/src/view_manager/public/cpp/tests/DEPS
new file mode 100644
index 0000000..0f9ddb4
--- /dev/null
+++ b/third_party/mojo_services/src/view_manager/public/cpp/tests/DEPS
@@ -0,0 +1,16 @@
+include_rules = [
+ "+mojo/services/geometry/public",
+
+ # TODO(blundell): Determine whether to eliminate these dependencies or move
+ # the tests outside of view_manager's public code. crbug.com/451403
+ "!base/auto_reset.h",
+ "!base/bind.h",
+ "!base/i18n/icu_util.h",
+ "!base/logging.h",
+ "!base/strings/stringprintf.h",
+ "!base/test/launcher/unit_test_launcher.h",
+ "!base/test/test_suite.h",
+ "!shell/application_manager",
+ "!shell/shell_test_helper.h",
+ "!ui/gfx/x/x11_connection.h",
+]
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/tests/run_all_unittests.cc b/third_party/mojo_services/src/view_manager/public/cpp/tests/view_manager_unittests.cc
index 95a7b5c..95a7b5c 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/tests/run_all_unittests.cc
+++ b/third_party/mojo_services/src/view_manager/public/cpp/tests/view_manager_unittests.cc
diff --git a/third_party/mojo_services/src/view_manager/public/cpp/view_observer.h b/third_party/mojo_services/src/view_manager/public/cpp/view_observer.h
index f059e11..7430566 100644
--- a/third_party/mojo_services/src/view_manager/public/cpp/view_observer.h
+++ b/third_party/mojo_services/src/view_manager/public/cpp/view_observer.h
@@ -61,7 +61,7 @@ class ViewObserver {
const ViewportMetrics& new_bounds) {
}
- virtual void OnViewCaptureChanged(View* gained_capture, View* lost_capture) {}
+ virtual void OnCaptureChanged(View* gained_capture, View* lost_capture) {}
virtual void OnViewFocusChanged(View* gained_focus, View* lost_focus) {}
virtual void OnViewActivationChanged(View* gained_active, View* lost_active) {
}
diff --git a/third_party/mojo_services/src/window_manager/public/interfaces/window_manager.mojom b/third_party/mojo_services/src/window_manager/public/interfaces/window_manager.mojom
index ee1b02e..e365fb6 100644
--- a/third_party/mojo_services/src/window_manager/public/interfaces/window_manager.mojom
+++ b/third_party/mojo_services/src/window_manager/public/interfaces/window_manager.mojom
@@ -7,30 +7,22 @@ module mojo;
import "input_events/public/interfaces/input_events.mojom";
import "mojo/public/interfaces/application/service_provider.mojom";
+[Client=WindowManagerClient]
interface WindowManager {
// Requests the WindowManager to embed the app for |url| at an appropriate
// View. See ViewMangerService::Embed() for details on |services| and
// |exposed_services|.
- Embed(string url,
- ServiceProvider&? services,
- ServiceProvider? exposed_services);
+ Embed(string url, ServiceProvider&? services, ServiceProvider? exposed_services);
SetCapture(uint32 view_id) => (bool success);
FocusWindow(uint32 view_id) => (bool success);
ActivateWindow(uint32 view_id) => (bool success);
- // Requests the current focus and activation state and an interface to observe
- // future changes.
- // If |observer| is not null capture, focus and activation updates will be
- // sent to it.
- GetFocusedAndActiveViews(WindowManagerObserver? observer)
- => (uint32 capture_view_id,
- uint32 focused_view_id,
- uint32 active_view_id);
+ GetFocusedAndActiveViews() => (uint32 focused_view_id, uint32 active_view_id);
};
-interface WindowManagerObserver {
- OnCaptureChanged(uint32 capture_view_id);
- OnFocusChanged(uint32 focused_view_id);
- OnActiveWindowChanged(uint32 focused_view_id);
+interface WindowManagerClient {
+ OnCaptureChanged(uint32 old_capture_view_id, uint32 new_capture_view_id);
+ OnFocusChanged(uint32 old_focused_view_id, uint32 new_focused_view_id);
+ OnActiveWindowChanged(uint32 old_focused_view_id, uint32 new_focused_view_id);
};