Commit 344b4602 authored by sky's avatar sky Committed by Commit bot

Rename RootViewManager to DisplayManager

DisplayManager is a better name for what the object is intended to do.

BUG=none
TEST=none
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/510483003

Cr-Commit-Position: refs/heads/master@{#292077}
parent 14b72ec3
...@@ -698,10 +698,13 @@ ...@@ -698,10 +698,13 @@
'sources': [ 'sources': [
'services/view_manager/access_policy.h', 'services/view_manager/access_policy.h',
'services/view_manager/access_policy_delegate.h', 'services/view_manager/access_policy_delegate.h',
'services/view_manager/context_factory_impl.cc',
'services/view_manager/context_factory_impl.h',
'services/view_manager/default_access_policy.cc', 'services/view_manager/default_access_policy.cc',
'services/view_manager/default_access_policy.h', 'services/view_manager/default_access_policy.h',
'services/view_manager/window_manager_access_policy.cc', 'services/view_manager/display_manager.cc',
'services/view_manager/window_manager_access_policy.h', 'services/view_manager/display_manager.h',
'services/view_manager/display_manager_delegate.h',
'services/view_manager/ids.h', 'services/view_manager/ids.h',
'services/view_manager/main.cc', 'services/view_manager/main.cc',
'services/view_manager/node.cc', 'services/view_manager/node.cc',
...@@ -709,9 +712,6 @@ ...@@ -709,9 +712,6 @@
'services/view_manager/node_delegate.h', 'services/view_manager/node_delegate.h',
'services/view_manager/root_node_manager.cc', 'services/view_manager/root_node_manager.cc',
'services/view_manager/root_node_manager.h', 'services/view_manager/root_node_manager.h',
'services/view_manager/root_view_manager.cc',
'services/view_manager/root_view_manager.h',
'services/view_manager/root_view_manager_delegate.h',
'services/view_manager/screen_impl.cc', 'services/view_manager/screen_impl.cc',
'services/view_manager/screen_impl.h', 'services/view_manager/screen_impl.h',
'services/view_manager/view_manager_export.h', 'services/view_manager/view_manager_export.h',
...@@ -721,8 +721,8 @@ ...@@ -721,8 +721,8 @@
'services/view_manager/view_manager_init_service_impl.h', 'services/view_manager/view_manager_init_service_impl.h',
'services/view_manager/view_manager_service_impl.cc', 'services/view_manager/view_manager_service_impl.cc',
'services/view_manager/view_manager_service_impl.h', 'services/view_manager/view_manager_service_impl.h',
'services/view_manager/context_factory_impl.cc', 'services/view_manager/window_manager_access_policy.cc',
'services/view_manager/context_factory_impl.h', 'services/view_manager/window_manager_access_policy.h',
'services/view_manager/window_tree_host_impl.cc', 'services/view_manager/window_tree_host_impl.cc',
'services/view_manager/window_tree_host_impl.h', 'services/view_manager/window_tree_host_impl.h',
], ],
......
...@@ -43,6 +43,9 @@ component("view_manager") { ...@@ -43,6 +43,9 @@ component("view_manager") {
"context_factory_impl.h", "context_factory_impl.h",
"default_access_policy.cc", "default_access_policy.cc",
"default_access_policy.h", "default_access_policy.h",
"display_manager.cc",
"display_manager.h",
"display_manager_delegate.h",
"ids.h", "ids.h",
"main.cc", "main.cc",
"node.cc", "node.cc",
...@@ -50,9 +53,6 @@ component("view_manager") { ...@@ -50,9 +53,6 @@ component("view_manager") {
"node_delegate.h", "node_delegate.h",
"root_node_manager.cc", "root_node_manager.cc",
"root_node_manager.h", "root_node_manager.h",
"root_view_manager.cc",
"root_view_manager.h",
"root_view_manager_delegate.h",
"screen_impl.cc", "screen_impl.cc",
"screen_impl.h", "screen_impl.h",
"view_manager_export.h", "view_manager_export.h",
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "mojo/services/view_manager/root_view_manager.h" #include "mojo/services/view_manager/display_manager.h"
#include "base/auto_reset.h" #include "base/auto_reset.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "mojo/public/cpp/application/application_connection.h" #include "mojo/public/cpp/application/application_connection.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h" #include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/view_manager/display_manager_delegate.h"
#include "mojo/services/view_manager/root_node_manager.h" #include "mojo/services/view_manager/root_node_manager.h"
#include "mojo/services/view_manager/root_view_manager_delegate.h"
#include "mojo/services/view_manager/screen_impl.h" #include "mojo/services/view_manager/screen_impl.h"
#include "mojo/services/view_manager/window_tree_host_impl.h" #include "mojo/services/view_manager/window_tree_host_impl.h"
#include "ui/aura/client/default_capture_client.h" #include "ui/aura/client/default_capture_client.h"
...@@ -54,7 +54,7 @@ void PaintNodeTree(gfx::Canvas* canvas, ...@@ -54,7 +54,7 @@ void PaintNodeTree(gfx::Canvas* canvas,
} // namespace } // namespace
class RootViewManager::RootWindowDelegateImpl : public aura::WindowDelegate { class DisplayManager::RootWindowDelegateImpl : public aura::WindowDelegate {
public: public:
explicit RootWindowDelegateImpl(const Node* root_node) explicit RootWindowDelegateImpl(const Node* root_node)
: root_node_(root_node) {} : root_node_(root_node) {}
...@@ -157,10 +157,10 @@ class WindowTreeClientImpl : public aura::client::WindowTreeClient { ...@@ -157,10 +157,10 @@ class WindowTreeClientImpl : public aura::client::WindowTreeClient {
DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl);
}; };
RootViewManager::RootViewManager( DisplayManager::DisplayManager(
ApplicationConnection* app_connection, ApplicationConnection* app_connection,
RootNodeManager* root_node, RootNodeManager* root_node,
RootViewManagerDelegate* delegate, DisplayManagerDelegate* delegate,
const Callback<void()>& native_viewport_closed_callback) const Callback<void()>& native_viewport_closed_callback)
: delegate_(delegate), : delegate_(delegate),
root_node_manager_(root_node), root_node_manager_(root_node),
...@@ -179,24 +179,24 @@ RootViewManager::RootViewManager( ...@@ -179,24 +179,24 @@ RootViewManager::RootViewManager(
viewport.Pass(), viewport.Pass(),
gpu_service.Pass(), gpu_service.Pass(),
gfx::Rect(800, 600), gfx::Rect(800, 600),
base::Bind(&RootViewManager::OnCompositorCreated, base::Unretained(this)), base::Bind(&DisplayManager::OnCompositorCreated, base::Unretained(this)),
native_viewport_closed_callback, native_viewport_closed_callback,
base::Bind(&RootNodeManager::DispatchNodeInputEventToWindowManager, base::Bind(&RootNodeManager::DispatchNodeInputEventToWindowManager,
base::Unretained(root_node_manager_)))); base::Unretained(root_node_manager_))));
} }
RootViewManager::~RootViewManager() { DisplayManager::~DisplayManager() {
window_tree_client_.reset(); window_tree_client_.reset();
window_tree_host_.reset(); window_tree_host_.reset();
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL);
} }
void RootViewManager::SchedulePaint(const Node* node, const gfx::Rect& bounds) { void DisplayManager::SchedulePaint(const Node* node, const gfx::Rect& bounds) {
if (root_window_) if (root_window_)
root_window_->SchedulePaintInRect(ConvertRectToRoot(node, bounds)); root_window_->SchedulePaintInRect(ConvertRectToRoot(node, bounds));
} }
void RootViewManager::OnCompositorCreated() { void DisplayManager::OnCompositorCreated() {
base::AutoReset<bool> resetter(&in_setup_, true); base::AutoReset<bool> resetter(&in_setup_, true);
window_tree_host_->InitHost(); window_tree_host_->InitHost();
...@@ -221,7 +221,7 @@ void RootViewManager::OnCompositorCreated() { ...@@ -221,7 +221,7 @@ void RootViewManager::OnCompositorCreated() {
window_tree_host_->Show(); window_tree_host_->Show();
delegate_->OnRootViewManagerWindowTreeHostCreated(); delegate_->OnDisplayManagerWindowTreeHostCreated();
} }
} // namespace service } // namespace service
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_ #ifndef MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_
#define MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_ #define MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_
#include <map> #include <map>
...@@ -37,16 +37,16 @@ namespace service { ...@@ -37,16 +37,16 @@ namespace service {
class Node; class Node;
class RootNodeManager; class RootNodeManager;
class RootViewManagerDelegate; class DisplayManagerDelegate;
// RootViewManager binds the root node to an actual display. // DisplayManager binds the root node to an actual display.
class MOJO_VIEW_MANAGER_EXPORT RootViewManager { class MOJO_VIEW_MANAGER_EXPORT DisplayManager {
public: public:
RootViewManager(ApplicationConnection* app_connection, DisplayManager(ApplicationConnection* app_connection,
RootNodeManager* root_node, RootNodeManager* root_node,
RootViewManagerDelegate* delegate, DisplayManagerDelegate* delegate,
const Callback<void()>& native_viewport_closed_callback); const Callback<void()>& native_viewport_closed_callback);
virtual ~RootViewManager(); virtual ~DisplayManager();
// Schedules a paint for the specified region of the specified node. // Schedules a paint for the specified region of the specified node.
void SchedulePaint(const Node* node, const gfx::Rect& bounds); void SchedulePaint(const Node* node, const gfx::Rect& bounds);
...@@ -59,7 +59,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootViewManager { ...@@ -59,7 +59,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootViewManager {
void OnCompositorCreated(); void OnCompositorCreated();
RootViewManagerDelegate* delegate_; DisplayManagerDelegate* delegate_;
RootNodeManager* root_node_manager_; RootNodeManager* root_node_manager_;
...@@ -76,10 +76,10 @@ class MOJO_VIEW_MANAGER_EXPORT RootViewManager { ...@@ -76,10 +76,10 @@ class MOJO_VIEW_MANAGER_EXPORT RootViewManager {
scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
scoped_ptr<aura::client::FocusClient> focus_client_; scoped_ptr<aura::client::FocusClient> focus_client_;
DISALLOW_COPY_AND_ASSIGN(RootViewManager); DISALLOW_COPY_AND_ASSIGN(DisplayManager);
}; };
} // namespace service } // namespace service
} // namespace mojo } // namespace mojo
#endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_ #endif // MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_DELEGATE_H_ #ifndef MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_DELEGATE_H_
#define MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_DELEGATE_H_ #define MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_DELEGATE_H_
#include "mojo/services/view_manager/view_manager_export.h" #include "mojo/services/view_manager/view_manager_export.h"
namespace mojo { namespace mojo {
namespace service { namespace service {
class MOJO_VIEW_MANAGER_EXPORT RootViewManagerDelegate { class MOJO_VIEW_MANAGER_EXPORT DisplayManagerDelegate {
public: public:
// Invoked when the WindowTreeHost is ready. // Invoked when the WindowTreeHost is ready.
virtual void OnRootViewManagerWindowTreeHostCreated() = 0; virtual void OnDisplayManagerWindowTreeHostCreated() = 0;
protected: protected:
virtual ~RootViewManagerDelegate() {} virtual ~DisplayManagerDelegate() {}
}; };
} // namespace service } // namespace service
} // namespace mojo } // namespace mojo
#endif // MOJO_SERVICES_VIEW_MANAGER_ROOT_VIEW_MANAGER_H_ #endif // MOJO_SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_DELEGATE_H_
...@@ -39,14 +39,14 @@ RootNodeManager::Context::~Context() { ...@@ -39,14 +39,14 @@ RootNodeManager::Context::~Context() {
RootNodeManager::RootNodeManager( RootNodeManager::RootNodeManager(
ApplicationConnection* app_connection, ApplicationConnection* app_connection,
RootViewManagerDelegate* view_manager_delegate, DisplayManagerDelegate* display_manager_delegate,
const Callback<void()>& native_viewport_closed_callback) const Callback<void()>& native_viewport_closed_callback)
: app_connection_(app_connection), : app_connection_(app_connection),
next_connection_id_(1), next_connection_id_(1),
root_view_manager_(app_connection, display_manager_(app_connection,
this, this,
view_manager_delegate, display_manager_delegate,
native_viewport_closed_callback), native_viewport_closed_callback),
root_(new Node(this, RootNodeId())), root_(new Node(this, RootNodeId())),
current_change_(NULL) { current_change_(NULL) {
} }
...@@ -244,7 +244,7 @@ void RootNodeManager::OnNodeDestroyed(const Node* node) { ...@@ -244,7 +244,7 @@ void RootNodeManager::OnNodeDestroyed(const Node* node) {
void RootNodeManager::OnNodeHierarchyChanged(const Node* node, void RootNodeManager::OnNodeHierarchyChanged(const Node* node,
const Node* new_parent, const Node* new_parent,
const Node* old_parent) { const Node* old_parent) {
if (!root_view_manager_.in_setup()) if (!display_manager_.in_setup())
ProcessNodeHierarchyChanged(node, new_parent, old_parent); ProcessNodeHierarchyChanged(node, new_parent, old_parent);
} }
...@@ -256,12 +256,12 @@ void RootNodeManager::OnNodeBoundsChanged(const Node* node, ...@@ -256,12 +256,12 @@ void RootNodeManager::OnNodeBoundsChanged(const Node* node,
return; return;
// TODO(sky): optimize this. // TODO(sky): optimize this.
root_view_manager_.SchedulePaint(node->parent(), old_bounds); display_manager_.SchedulePaint(node->parent(), old_bounds);
root_view_manager_.SchedulePaint(node->parent(), new_bounds); display_manager_.SchedulePaint(node->parent(), new_bounds);
} }
void RootNodeManager::OnNodeBitmapChanged(const Node* node) { void RootNodeManager::OnNodeBitmapChanged(const Node* node) {
root_view_manager_.SchedulePaint(node, gfx::Rect(node->bounds().size())); display_manager_.SchedulePaint(node, gfx::Rect(node->bounds().size()));
} }
} // namespace service } // namespace service
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "mojo/public/cpp/bindings/array.h" #include "mojo/public/cpp/bindings/array.h"
#include "mojo/services/view_manager/display_manager.h"
#include "mojo/services/view_manager/ids.h" #include "mojo/services/view_manager/ids.h"
#include "mojo/services/view_manager/node.h" #include "mojo/services/view_manager/node.h"
#include "mojo/services/view_manager/node_delegate.h" #include "mojo/services/view_manager/node_delegate.h"
#include "mojo/services/view_manager/root_view_manager.h"
#include "mojo/services/view_manager/view_manager_export.h" #include "mojo/services/view_manager/view_manager_export.h"
namespace ui { namespace ui {
...@@ -26,7 +26,7 @@ class ApplicationConnection; ...@@ -26,7 +26,7 @@ class ApplicationConnection;
namespace service { namespace service {
class RootViewManagerDelegate; class DisplayManagerDelegate;
class ViewManagerServiceImpl; class ViewManagerServiceImpl;
// RootNodeManager is responsible for managing the set of // RootNodeManager is responsible for managing the set of
...@@ -67,7 +67,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate { ...@@ -67,7 +67,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
}; };
RootNodeManager(ApplicationConnection* app_connection, RootNodeManager(ApplicationConnection* app_connection,
RootViewManagerDelegate* view_manager_delegate, DisplayManagerDelegate* display_manager_delegate,
const Callback<void()>& native_viewport_closed_callback); const Callback<void()>& native_viewport_closed_callback);
virtual ~RootNodeManager(); virtual ~RootNodeManager();
...@@ -188,7 +188,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate { ...@@ -188,7 +188,7 @@ class MOJO_VIEW_MANAGER_EXPORT RootNodeManager : public NodeDelegate {
// Set of ViewManagerServiceImpls. // Set of ViewManagerServiceImpls.
ConnectionMap connection_map_; ConnectionMap connection_map_;
RootViewManager root_view_manager_; DisplayManager display_manager_;
// Root node. // Root node.
scoped_ptr<Node> root_; scoped_ptr<Node> root_;
......
...@@ -67,7 +67,7 @@ void ViewManagerInitServiceContext::Embed( ...@@ -67,7 +67,7 @@ void ViewManagerInitServiceContext::Embed(
MaybeEmbed(); MaybeEmbed();
} }
void ViewManagerInitServiceContext::OnRootViewManagerWindowTreeHostCreated() { void ViewManagerInitServiceContext::OnDisplayManagerWindowTreeHostCreated() {
DCHECK(!is_tree_host_ready_); DCHECK(!is_tree_host_ready_);
is_tree_host_ready_ = true; is_tree_host_ready_ = true;
MaybeEmbed(); MaybeEmbed();
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "mojo/public/cpp/application/application_connection.h" #include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h" #include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/services/view_manager/root_view_manager_delegate.h" #include "mojo/services/view_manager/display_manager_delegate.h"
#include "mojo/services/view_manager/view_manager_export.h" #include "mojo/services/view_manager/view_manager_export.h"
namespace mojo { namespace mojo {
...@@ -22,7 +22,7 @@ class ViewManagerInitServiceImpl; ...@@ -22,7 +22,7 @@ class ViewManagerInitServiceImpl;
// State shared between all ViewManagerInitService impls. // State shared between all ViewManagerInitService impls.
class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceContext class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceContext
: public RootViewManagerDelegate { : public DisplayManagerDelegate {
public: public:
ViewManagerInitServiceContext(); ViewManagerInitServiceContext();
virtual ~ViewManagerInitServiceContext(); virtual ~ViewManagerInitServiceContext();
...@@ -52,8 +52,8 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceContext ...@@ -52,8 +52,8 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceContext
Callback<void(bool)> callback; Callback<void(bool)> callback;
}; };
// RootViewManagerDelegate overrides: // DisplayManagerDelegate overrides:
virtual void OnRootViewManagerWindowTreeHostCreated() OVERRIDE; virtual void OnDisplayManagerWindowTreeHostCreated() OVERRIDE;
void OnNativeViewportDeleted(); void OnNativeViewportDeleted();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment