diff options
author | rockot <rockot@chromium.org> | 2015-03-03 19:17:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-04 03:17:52 +0000 |
commit | 8c522ea0f84229c2dba86756bc7c9923610b439f (patch) | |
tree | 2bd46372a5e236e94755d9449c6baf660fbbe923 /third_party/mojo_services | |
parent | 8ab5046b4a0f6eb8f3976b6693624d6371a042fb (diff) | |
download | chromium_src-8c522ea0f84229c2dba86756bc7c9923610b439f.zip chromium_src-8c522ea0f84229c2dba86756bc7c9923610b439f.tar.gz chromium_src-8c522ea0f84229c2dba86756bc7c9923610b439f.tar.bz2 |
Update mojo sdk to rev f68e697e389943cd9bf9652397312280e96b127a
BUG=
TBR=jamesr@chromium.org
Review URL: https://codereview.chromium.org/975973002
Cr-Commit-Position: refs/heads/master@{#319012}
Diffstat (limited to 'third_party/mojo_services')
10 files changed, 52 insertions, 5 deletions
diff --git a/third_party/mojo_services/src/input_events/public/interfaces/BUILD.gn b/third_party/mojo_services/src/input_events/public/interfaces/BUILD.gn index bf9b729..e7a75f2 100644 --- a/third_party/mojo_services/src/input_events/public/interfaces/BUILD.gn +++ b/third_party/mojo_services/src/input_events/public/interfaces/BUILD.gn @@ -7,8 +7,8 @@ import("$mojo_sdk_root/mojo/public/tools/bindings/mojom.gni") mojom("interfaces") { sources = [ - "input_event_constants.mojom", "input_events.mojom", + "input_event_constants.mojom", "input_key_codes.mojom", ] diff --git a/third_party/mojo_services/src/native_viewport/public/cpp/BUILD.gn b/third_party/mojo_services/src/native_viewport/public/cpp/BUILD.gn index af47d38..035ddfa 100644 --- a/third_party/mojo_services/src/native_viewport/public/cpp/BUILD.gn +++ b/third_party/mojo_services/src/native_viewport/public/cpp/BUILD.gn @@ -8,7 +8,7 @@ import("$mojo_sdk_root/mojo/public/mojo_sdk.gni") mojo_sdk_source_set("args") { public_configs = [ "../../../public/build/config:mojo_services" ] sources = [ - "args.h", "lib/args.cc", + "args.h", ] } diff --git a/third_party/mojo_services/src/navigation/public/interfaces/navigation.mojom b/third_party/mojo_services/src/navigation/public/interfaces/navigation.mojom index 0d2656a..b461a2b 100644 --- a/third_party/mojo_services/src/navigation/public/interfaces/navigation.mojom +++ b/third_party/mojo_services/src/navigation/public/interfaces/navigation.mojom @@ -21,6 +21,7 @@ enum Target { // Embedders that support navigation of implement this interface. interface NavigatorHost { RequestNavigate(Target target, URLRequest request); + RequestNavigateHistory(int32 delta); // Applications call this to inform hosts of navigations they performed // locally. For example, pushState() navigations in an HTML application. diff --git a/third_party/mojo_services/src/surfaces/public/interfaces/quads.mojom b/third_party/mojo_services/src/surfaces/public/interfaces/quads.mojom index 58f85e0..2418d51 100644 --- a/third_party/mojo_services/src/surfaces/public/interfaces/quads.mojom +++ b/third_party/mojo_services/src/surfaces/public/interfaces/quads.mojom @@ -79,7 +79,8 @@ struct StreamVideoQuadState {}; enum YUVColorSpace { REC_601, // SDTV standard with restricted "studio swing" color range. - REC_601_JPEG, // Full color range [0, 255] variant of the above. + REC_709, // HDTV standard with restricted "studio swing" color range. + JPEG, // Full color range [0, 255] JPEG color space. }; struct YUVVideoQuadState { diff --git a/third_party/mojo_services/src/view_manager/public/cpp/BUILD.gn b/third_party/mojo_services/src/view_manager/public/cpp/BUILD.gn index 72cb55e..d121021 100644 --- a/third_party/mojo_services/src/view_manager/public/cpp/BUILD.gn +++ b/third_party/mojo_services/src/view_manager/public/cpp/BUILD.gn @@ -21,6 +21,7 @@ mojo_sdk_source_set("cpp") { "view_manager.h", "view_manager_client_factory.h", "view_manager_context.h", + "view_manager_delegate.cc", "view_manager_delegate.h", "view_observer.h", "view_property.h", 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 9a3c022..b0d4b33 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 @@ -172,8 +172,8 @@ void ViewManagerClientImpl::SetSurfaceId(Id view_id, SurfaceIdPtr surface_id) { void ViewManagerClientImpl::SetFocus(Id view_id) { // In order for us to get here we had to have exposed a view, which implies we // got a connection. - DCHECK(window_manager_.get()); - window_manager_->FocusWindow(view_id, ActionCompletedCallback()); + DCHECK(service_); + service_->PerformAction(view_id, "focus", ActionCompletedCallback()); } void ViewManagerClientImpl::SetVisible(Id view_id, bool visible) { @@ -418,6 +418,14 @@ void ViewManagerClientImpl::OnViewInputEvent( ack_callback.Run(); } +void ViewManagerClientImpl::OnPerformAction( + Id view_id, + const String& name, + const Callback<void(bool)>& callback) { + View* view = GetViewById(view_id); + callback.Run(delegate_->OnPerformAction(view, name)); +} + //////////////////////////////////////////////////////////////////////////////// // ViewManagerClientImpl, WindowManagerObserver implementation: 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 94db93d..3bdfd7f 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 @@ -119,6 +119,9 @@ class ViewManagerClientImpl : public ViewManager, void OnViewInputEvent(Id view_id, EventPtr event, const Callback<void()>& callback) override; + void OnPerformAction(Id view_id, + const String& name, + const Callback<void(bool)>& callback) override; // Overridden from WindowManagerObserver: void OnCaptureChanged(Id capture_view_id) override; diff --git a/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.cc b/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.cc new file mode 100644 index 0000000..4ae64a7 --- /dev/null +++ b/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.cc @@ -0,0 +1,14 @@ +// 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 "view_manager/public/cpp/view_manager_delegate.h" + +namespace mojo { + +bool ViewManagerDelegate::OnPerformAction(View* view, + const std::string& action) { + return false; +} + +} // namespace mojo diff --git a/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.h b/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.h index e78e925..1590a591 100644 --- a/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.h +++ b/third_party/mojo_services/src/view_manager/public/cpp/view_manager_delegate.h @@ -5,6 +5,8 @@ #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ +#include <string> + #include "mojo/public/interfaces/application/service_provider.mojom.h" namespace mojo { @@ -37,6 +39,10 @@ class ViewManagerDelegate { // |view_manager| is not valid after this function returns. virtual void OnViewManagerDisconnected(ViewManager* view_manager) = 0; + // Asks the delegate to perform the specified action. + // TODO(sky): nuke! See comments in view_manager.mojom for details. + virtual bool OnPerformAction(View* view, const std::string& action); + protected: virtual ~ViewManagerDelegate() {} }; diff --git a/third_party/mojo_services/src/view_manager/public/interfaces/view_manager.mojom b/third_party/mojo_services/src/view_manager/public/interfaces/view_manager.mojom index 3bd8f1e..0a2564e 100644 --- a/third_party/mojo_services/src/view_manager/public/interfaces/view_manager.mojom +++ b/third_party/mojo_services/src/view_manager/public/interfaces/view_manager.mojom @@ -142,6 +142,14 @@ interface ViewManagerService { ServiceProvider&? services, ServiceProvider? exposed_services) => (bool success); Embed(uint32 view_id, ViewManagerClient client) => (bool success); + + // Requests the WindowManager to perform an action on the specified view. + // It's up to the WindowManager to decide what |action| is. + // + // TODO(sky): nuke this. This is here to guarantee the state of the + // WindowManager matches that of the ViewManager at the time the client + // invokes the function. When we can enforce ordering this won't be necessary. + PerformAction(uint32 view_id, string action) => (bool success); }; // Changes to views are not sent to the connection that originated the @@ -214,4 +222,9 @@ interface ViewManagerClient { // Invoked when an event is targeted at the specified view. OnViewInputEvent(uint32 view, mojo.Event event) => (); + + // Invoked solely on the WindowManager. See comments in PerformAction() above + // for details. + // TODO(sky): nuke this. + OnPerformAction(uint32 view_id, string action) => (bool success); }; |