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

Unified Diff: mojo/services/window_manager/window_manager_app.h

Issue 405523002: Add ability APIs for opening a window with a url embedded, focusing and activating a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
Index: mojo/services/window_manager/window_manager_app.h
diff --git a/mojo/services/window_manager/window_manager_app.h b/mojo/services/window_manager/window_manager_app.h
index 6f4c64cfbe04de51e87a772c4ab6f9bc064c4093..9792f76e1788b06c52f969fcacedb4025ba764e4 100644
--- a/mojo/services/window_manager/window_manager_app.h
+++ b/mojo/services/window_manager/window_manager_app.h
@@ -10,10 +10,18 @@
#include "base/memory/scoped_ptr.h"
#include "mojo/aura/window_tree_host_mojo_delegate.h"
#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/services/public/cpp/view_manager/node_observer.h"
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
+#include "ui/aura/client/focus_change_observer.h"
+#include "ui/wm/public/activation_change_observer.h"
namespace aura {
+namespace client {
+class ActivationClient;
+class FocusClient;
+}
class Window;
}
@@ -29,7 +37,10 @@ class WindowTreeHostMojo;
class WindowManagerApp : public ApplicationDelegate,
public view_manager::ViewManagerDelegate,
- public WindowTreeHostMojoDelegate {
+ public view_manager::NodeObserver,
+ public WindowTreeHostMojoDelegate,
+ public aura::client::FocusChangeObserver,
+ public aura::client::ActivationChangeObserver {
public:
WindowManagerApp();
virtual ~WindowManagerApp();
@@ -38,12 +49,16 @@ class WindowManagerApp : public ApplicationDelegate,
void RemoveConnection(WindowManagerServiceImpl* connection);
view_manager::Id OpenWindow();
+ view_manager::Id OpenWindowWithURL(const String& url);
void SetCapture(view_manager::Id node);
+ void FocusWindow(view_manager::Id node);
+ void ActivateWindow(view_manager::Id node);
bool IsReady() const;
private:
typedef std::set<WindowManagerServiceImpl*> Connections;
+ typedef std::map<view_manager::Id, aura::Window*> NodeIdToWindowMap;
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE;
@@ -56,11 +71,32 @@ class WindowManagerApp : public ApplicationDelegate,
virtual void OnViewManagerDisconnected(
view_manager::ViewManager* view_manager) MOJO_OVERRIDE;
+ // Overridden from view_manager::NodeObserver:
+ virtual void OnTreeChanged(
+ const view_manager::NodeObserver::TreeChangeParams& params) MOJO_OVERRIDE;
+
// Overridden from WindowTreeHostMojoDelegate:
virtual void CompositorContentsChanged(const SkBitmap& bitmap) MOJO_OVERRIDE;
+ // Overridden from aura::client::FocusChangeObserver:
+ virtual void OnWindowFocused(aura::Window* gained_focus,
+ aura::Window* lost_focus) MOJO_OVERRIDE;
+
+ // Overridden from aura::client::ActivationChangeObserver:
+ virtual void OnWindowActivated(aura::Window* gained_active,
+ aura::Window* lost_active) MOJO_OVERRIDE;
+
aura::Window* GetWindowForNodeId(view_manager::Id node) const;
+ // Creates an aura::Window for every node in the hierarchy beneath |id|,
+ // and adds to the registry so that it can be retrieved later via
+ // GetWindowForNodeId().
+ // TODO(beng): perhaps Node should have a property bag.
+ void RegisterSubtree(view_manager::Id id, aura::Window* parent);
+ // Deletes the aura::Windows associated with the hierarchy beneath |id|,
+ // and removes from the registry.
+ void UnregisterSubtree(view_manager::Id id);
+
view_manager::ViewManager* view_manager_;
view_manager::Node* root_;
@@ -68,8 +104,11 @@ class WindowManagerApp : public ApplicationDelegate,
scoped_ptr<WindowTreeHostMojo> window_tree_host_;
scoped_ptr<wm::ScopedCaptureClient> capture_client_;
+ scoped_ptr<aura::client::FocusClient> focus_client_;
+ aura::client::ActivationClient* activation_client_;
Connections connections_;
+ NodeIdToWindowMap node_id_to_window_map_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerApp);
};
« no previous file with comments | « mojo/services/window_manager/window_manager_api_unittest.cc ('k') | mojo/services/window_manager/window_manager_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698