summaryrefslogtreecommitdiffstats
path: root/mojo/examples/window_manager
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-19 06:19:54 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-19 06:19:54 +0000
commitb567f3d86662dce4bb1c5f0449220253fa6b92a5 (patch)
treea7f50453b7ec86d29e5ddb31e736104ea1267c43 /mojo/examples/window_manager
parent2809e927094c8010513b08fad93a3c606fa40ba2 (diff)
downloadchromium_src-b567f3d86662dce4bb1c5f0449220253fa6b92a5.zip
chromium_src-b567f3d86662dce4bb1c5f0449220253fa6b92a5.tar.gz
chromium_src-b567f3d86662dce4bb1c5f0449220253fa6b92a5.tar.bz2
Revert 284322 "Allow EmbedRoot to be called multiple times."
> Allow EmbedRoot to be called multiple times. > > Subsequent calls to EmbedRoot are now delegated to the window manager. This allows an application that was not created via the embed flow to obtain a connection to the view manager by asking the view manager init service to embed it somewhere. The init service just forwards this to the window manager. This is effectively like asking the window manager to create a toplevel window. > > R=sky@chromium.org > BUG=none > > Review URL: https://codereview.chromium.org/403083002 TBR=ben@chromium.org Review URL: https://codereview.chromium.org/405803002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/window_manager')
-rw-r--r--mojo/examples/window_manager/window_manager.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index 057c101..e1cb54d 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -15,9 +15,9 @@
#include "mojo/services/public/cpp/view_manager/node.h"
#include "mojo/services/public/cpp/view_manager/node_observer.h"
#include "mojo/services/public/cpp/view_manager/view.h"
+#include "mojo/services/public/cpp/view_manager/view_event_dispatcher.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/public/cpp/view_manager/window_manager_delegate.h"
#include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
#include "mojo/services/public/interfaces/launcher/launcher.mojom.h"
#include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
@@ -34,10 +34,10 @@ using mojo::view_manager::Id;
using mojo::view_manager::Node;
using mojo::view_manager::NodeObserver;
using mojo::view_manager::View;
+using mojo::view_manager::ViewEventDispatcher;
using mojo::view_manager::ViewManager;
using mojo::view_manager::ViewManagerDelegate;
using mojo::view_manager::ViewObserver;
-using mojo::view_manager::WindowManagerDelegate;
namespace mojo {
namespace examples {
@@ -252,7 +252,7 @@ class RootLayoutManager : public NodeObserver {
class WindowManager : public ApplicationDelegate,
public DebugPanel::Delegate,
public ViewManagerDelegate,
- public WindowManagerDelegate {
+ public ViewEventDispatcher {
public:
WindowManager()
: launcher_ui_(NULL),
@@ -339,7 +339,7 @@ class WindowManager : public ApplicationDelegate,
virtual void OnRootAdded(ViewManager* view_manager, Node* root) OVERRIDE {
DCHECK(!view_manager_);
view_manager_ = view_manager;
- view_manager_->SetWindowManagerDelegate(this);
+ view_manager_->SetEventDispatcher(this);
Node* node = Node::Create(view_manager_);
root->AddChild(node);
@@ -366,12 +366,7 @@ class WindowManager : public ApplicationDelegate,
base::MessageLoop::current()->Quit();
}
- // Overridden from WindowManagerDelegate:
- virtual void EmbedRoot(const String& url) OVERRIDE {
- CreateWindow(url,
- navigation::NavigationDetailsPtr().Pass(),
- navigation::ResponseDetailsPtr().Pass());
- }
+ // Overridden from ViewEventDispatcher:
virtual void DispatchEvent(View* target, EventPtr event) OVERRIDE {
// TODO(beng): More sophisticated focus handling than this is required!
if (event->action == ui::ET_MOUSE_PRESSED &&