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

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

Issue 636363002: Splits window manager like methods into ViewManagerServiceDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 6 years, 2 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 | « mojo/services/window_manager/window_manager_service_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/window_manager/window_manager_service_impl.cc
diff --git a/mojo/services/window_manager/window_manager_service_impl.cc b/mojo/services/window_manager/window_manager_service_impl.cc
index aa1be19e6742469a2e2aecff73f4c814e70d3e5a..2ceee5c25e700a137dbe2e88017d03f05716e881 100644
--- a/mojo/services/window_manager/window_manager_service_impl.cc
+++ b/mojo/services/window_manager/window_manager_service_impl.cc
@@ -1,80 +1,37 @@
-
// 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 "mojo/services/window_manager/window_manager_service_impl.h"
+#include "mojo/aura/window_tree_host_mojo.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
#include "mojo/services/window_manager/window_manager_app.h"
+#include "mojo/services/window_manager/window_manager_delegate.h"
namespace mojo {
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, public:
-
-WindowManagerServiceImpl::WindowManagerServiceImpl(
- WindowManagerApp* window_manager)
- : window_manager_(window_manager) {
- window_manager_->AddConnection(this);
+WindowManagerServiceImpl::WindowManagerServiceImpl(WindowManagerApp* app)
+ : app_(app) {
}
WindowManagerServiceImpl::~WindowManagerServiceImpl() {
- window_manager_->RemoveConnection(this);
-}
-
-void WindowManagerServiceImpl::NotifyReady() {
- client()->OnWindowManagerReady();
-}
-
-void WindowManagerServiceImpl::NotifyViewFocused(Id new_focused_id,
- Id old_focused_id) {
- client()->OnFocusChanged(old_focused_id, new_focused_id);
}
-void WindowManagerServiceImpl::NotifyWindowActivated(Id new_active_id,
- Id old_active_id) {
- client()->OnActiveWindowChanged(old_active_id, new_active_id);
+void WindowManagerServiceImpl::Embed(
+ const String& url,
+ InterfaceRequest<ServiceProvider> service_provider) {
+ app_->window_manager_delegate()->Embed(url, service_provider.Pass());
}
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, WindowManager implementation:
-
-void WindowManagerServiceImpl::SetCapture(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->SetCapture(view);
- callback.Run(success);
-}
-
-void WindowManagerServiceImpl::FocusWindow(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->FocusWindow(view);
- callback.Run(success);
+void WindowManagerServiceImpl::OnViewInputEvent(mojo::EventPtr event) {
+ scoped_ptr<ui::Event> ui_event = event.To<scoped_ptr<ui::Event>>();
+ if (ui_event)
+ app_->host()->SendEventToProcessor(ui_event.get());
}
-void WindowManagerServiceImpl::ActivateWindow(
- Id view,
- const Callback<void(bool)>& callback) {
- bool success = window_manager_->IsReady();
- if (success)
- window_manager_->ActivateWindow(view);
- callback.Run(success);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// WindowManagerServiceImpl, InterfaceImpl overrides:
-
void WindowManagerServiceImpl::OnConnectionEstablished() {
- // If the connection was established prior to the window manager being
- // embedded by the view manager, |window_manager_|'s ViewManagerDelegate
- // impl will call NotifyReady() when it is.
- if (window_manager_->IsReady())
- NotifyReady();
+ app_->set_window_manager_client(client());
}
} // namespace mojo
« no previous file with comments | « mojo/services/window_manager/window_manager_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698