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

Side by Side Diff: mojo/services/window_manager/window_manager_app.h

Issue 418983002: Nukes view_manager namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 5 #ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 namespace mojo { 35 namespace mojo {
36 36
37 class AuraInit; 37 class AuraInit;
38 class WindowManagerServiceImpl; 38 class WindowManagerServiceImpl;
39 class WindowTreeHostMojo; 39 class WindowTreeHostMojo;
40 40
41 class WindowManagerApp 41 class WindowManagerApp
42 : public ApplicationDelegate, 42 : public ApplicationDelegate,
43 public view_manager::ViewManagerDelegate, 43 public ViewManagerDelegate,
44 public view_manager::NodeObserver, 44 public NodeObserver,
45 public WindowTreeHostMojoDelegate, 45 public WindowTreeHostMojoDelegate,
46 public aura::client::FocusChangeObserver, 46 public aura::client::FocusChangeObserver,
47 public aura::client::ActivationChangeObserver, 47 public aura::client::ActivationChangeObserver,
48 public InterfaceFactoryWithContext<WindowManagerServiceImpl, 48 public InterfaceFactoryWithContext<WindowManagerServiceImpl,
49 WindowManagerApp> { 49 WindowManagerApp> {
50 public: 50 public:
51 explicit WindowManagerApp(view_manager::ViewManagerDelegate* delegate); 51 explicit WindowManagerApp(ViewManagerDelegate* delegate);
52 virtual ~WindowManagerApp(); 52 virtual ~WindowManagerApp();
53 53
54 void AddConnection(WindowManagerServiceImpl* connection); 54 void AddConnection(WindowManagerServiceImpl* connection);
55 void RemoveConnection(WindowManagerServiceImpl* connection); 55 void RemoveConnection(WindowManagerServiceImpl* connection);
56 56
57 view_manager::Id OpenWindow(); 57 Id OpenWindow();
58 view_manager::Id OpenWindowWithURL(const String& url); 58 Id OpenWindowWithURL(const String& url);
59 void SetCapture(view_manager::Id node); 59 void SetCapture(Id node);
60 void FocusWindow(view_manager::Id node); 60 void FocusWindow(Id node);
61 void ActivateWindow(view_manager::Id node); 61 void ActivateWindow(Id node);
62 62
63 bool IsReady() const; 63 bool IsReady() const;
64 64
65 // Overridden from ApplicationDelegate: 65 // Overridden from ApplicationDelegate:
66 virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE; 66 virtual void Initialize(ApplicationImpl* impl) MOJO_OVERRIDE;
67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
68 MOJO_OVERRIDE; 68 MOJO_OVERRIDE;
69 69
70 private: 70 private:
71 typedef std::set<WindowManagerServiceImpl*> Connections; 71 typedef std::set<WindowManagerServiceImpl*> Connections;
72 typedef std::map<view_manager::Id, aura::Window*> NodeIdToWindowMap; 72 typedef std::map<Id, aura::Window*> NodeIdToWindowMap;
73 73
74 // Overridden from view_manager::ViewManagerDelegate: 74 // Overridden from ViewManagerDelegate:
75 virtual void OnRootAdded(view_manager::ViewManager* view_manager, 75 virtual void OnRootAdded(ViewManager* view_manager,
76 view_manager::Node* root) MOJO_OVERRIDE; 76 Node* root) MOJO_OVERRIDE;
77 virtual void OnViewManagerDisconnected( 77 virtual void OnViewManagerDisconnected(
78 view_manager::ViewManager* view_manager) MOJO_OVERRIDE; 78 ViewManager* view_manager) MOJO_OVERRIDE;
79 79
80 // Overridden from view_manager::NodeObserver: 80 // Overridden from NodeObserver:
81 virtual void OnTreeChanged( 81 virtual void OnTreeChanged(
82 const view_manager::NodeObserver::TreeChangeParams& params) MOJO_OVERRIDE; 82 const NodeObserver::TreeChangeParams& params) MOJO_OVERRIDE;
83 83
84 // Overridden from WindowTreeHostMojoDelegate: 84 // Overridden from WindowTreeHostMojoDelegate:
85 virtual void CompositorContentsChanged(const SkBitmap& bitmap) MOJO_OVERRIDE; 85 virtual void CompositorContentsChanged(const SkBitmap& bitmap) MOJO_OVERRIDE;
86 86
87 // Overridden from aura::client::FocusChangeObserver: 87 // Overridden from aura::client::FocusChangeObserver:
88 virtual void OnWindowFocused(aura::Window* gained_focus, 88 virtual void OnWindowFocused(aura::Window* gained_focus,
89 aura::Window* lost_focus) MOJO_OVERRIDE; 89 aura::Window* lost_focus) MOJO_OVERRIDE;
90 90
91 // Overridden from aura::client::ActivationChangeObserver: 91 // Overridden from aura::client::ActivationChangeObserver:
92 virtual void OnWindowActivated(aura::Window* gained_active, 92 virtual void OnWindowActivated(aura::Window* gained_active,
93 aura::Window* lost_active) MOJO_OVERRIDE; 93 aura::Window* lost_active) MOJO_OVERRIDE;
94 94
95 aura::Window* GetWindowForNodeId(view_manager::Id node) const; 95 aura::Window* GetWindowForNodeId(Id node) const;
96 96
97 // Creates an aura::Window for every node in the hierarchy beneath |id|, 97 // Creates an aura::Window for every node in the hierarchy beneath |id|,
98 // and adds to the registry so that it can be retrieved later via 98 // and adds to the registry so that it can be retrieved later via
99 // GetWindowForNodeId(). 99 // GetWindowForNodeId().
100 // TODO(beng): perhaps Node should have a property bag. 100 // TODO(beng): perhaps Node should have a property bag.
101 void RegisterSubtree(view_manager::Id id, aura::Window* parent); 101 void RegisterSubtree(Id id, aura::Window* parent);
102 // Deletes the aura::Windows associated with the hierarchy beneath |id|, 102 // Deletes the aura::Windows associated with the hierarchy beneath |id|,
103 // and removes from the registry. 103 // and removes from the registry.
104 void UnregisterSubtree(view_manager::Id id); 104 void UnregisterSubtree(Id id);
105 105
106 view_manager::ViewManagerDelegate* wrapped_delegate_; 106 ViewManagerDelegate* wrapped_delegate_;
107 107
108 view_manager::ViewManager* view_manager_; 108 ViewManager* view_manager_;
109 view_manager::ViewManagerClientFactory view_manager_client_factory_; 109 ViewManagerClientFactory view_manager_client_factory_;
110 view_manager::Node* root_; 110 Node* root_;
111 111
112 scoped_ptr<AuraInit> aura_init_; 112 scoped_ptr<AuraInit> aura_init_;
113 scoped_ptr<WindowTreeHostMojo> window_tree_host_; 113 scoped_ptr<WindowTreeHostMojo> window_tree_host_;
114 114
115 scoped_ptr<wm::ScopedCaptureClient> capture_client_; 115 scoped_ptr<wm::ScopedCaptureClient> capture_client_;
116 scoped_ptr<aura::client::FocusClient> focus_client_; 116 scoped_ptr<aura::client::FocusClient> focus_client_;
117 aura::client::ActivationClient* activation_client_; 117 aura::client::ActivationClient* activation_client_;
118 118
119 Connections connections_; 119 Connections connections_;
120 NodeIdToWindowMap node_id_to_window_map_; 120 NodeIdToWindowMap node_id_to_window_map_;
121 121
122 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); 122 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp);
123 }; 123 };
124 124
125 } // namespace mojo 125 } // namespace mojo
126 126
127 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 127 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
OLDNEW
« 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