Index: components/mus/public/cpp/lib/view_tree_client_impl.cc |
diff --git a/components/mus/public/cpp/lib/view_tree_client_impl.cc b/components/mus/public/cpp/lib/view_tree_client_impl.cc |
index ceac2ee88367793be189e8be53b521b97759145f..43a19353c72494b9515bdac7bf988dc550fef84a 100644 |
--- a/components/mus/public/cpp/lib/view_tree_client_impl.cc |
+++ b/components/mus/public/cpp/lib/view_tree_client_impl.cc |
@@ -14,7 +14,7 @@ |
#include "mojo/application/public/cpp/service_provider_impl.h" |
#include "mojo/application/public/interfaces/service_provider.mojom.h" |
-namespace mojo { |
+namespace mus { |
Id MakeTransportId(ConnectionSpecificId connection_id, |
ConnectionSpecificId local_id) { |
@@ -24,7 +24,7 @@ Id MakeTransportId(ConnectionSpecificId connection_id, |
// Helper called to construct a local view object from transport data. |
View* AddViewToConnection(ViewTreeClientImpl* client, |
View* parent, |
- const ViewDataPtr& view_data) { |
+ const mojo::ViewDataPtr& view_data) { |
// We don't use the cto that takes a ViewTreeConnection here, since it will |
// call back to the service and attempt to create a new view. |
View* view = ViewPrivate::LocalCreate(); |
@@ -33,19 +33,19 @@ View* AddViewToConnection(ViewTreeClientImpl* client, |
private_view.set_id(view_data->view_id); |
private_view.set_visible(view_data->visible); |
private_view.set_drawn(view_data->drawn); |
- private_view.LocalSetViewportMetrics(ViewportMetrics(), |
+ private_view.LocalSetViewportMetrics(mojo::ViewportMetrics(), |
*view_data->viewport_metrics); |
private_view.set_properties( |
view_data->properties.To<std::map<std::string, std::vector<uint8_t>>>()); |
client->AddView(view); |
- private_view.LocalSetBounds(Rect(), *view_data->bounds); |
+ private_view.LocalSetBounds(mojo::Rect(), *view_data->bounds); |
if (parent) |
ViewPrivate(parent).LocalAddChild(view); |
return view; |
} |
View* BuildViewTree(ViewTreeClientImpl* client, |
- const Array<ViewDataPtr>& views, |
+ const mojo::Array<mojo::ViewDataPtr>& views, |
View* initial_parent) { |
std::vector<View*> parents; |
View* root = NULL; |
@@ -70,12 +70,13 @@ View* BuildViewTree(ViewTreeClientImpl* client, |
ViewTreeConnection* ViewTreeConnection::Create( |
ViewTreeDelegate* delegate, |
- InterfaceRequest<ViewTreeClient> request) { |
+ mojo::InterfaceRequest<mojo::ViewTreeClient> request) { |
return new ViewTreeClientImpl(delegate, request.Pass()); |
} |
-ViewTreeClientImpl::ViewTreeClientImpl(ViewTreeDelegate* delegate, |
- InterfaceRequest<ViewTreeClient> request) |
+ViewTreeClientImpl::ViewTreeClientImpl( |
+ ViewTreeDelegate* delegate, |
+ mojo::InterfaceRequest<mojo::ViewTreeClient> request) |
: connection_id_(0), |
next_id_(1), |
delegate_(delegate), |
@@ -128,7 +129,7 @@ void ViewTreeClientImpl::RemoveChild(Id child_id, Id parent_id) { |
void ViewTreeClientImpl::Reorder(Id view_id, |
Id relative_view_id, |
- OrderDirection direction) { |
+ mojo::OrderDirection direction) { |
DCHECK(tree_); |
tree_->ReorderView(view_id, relative_view_id, direction, |
ActionCompletedCallback()); |
@@ -138,7 +139,7 @@ bool ViewTreeClientImpl::OwnsView(Id id) const { |
return HiWord(id) == connection_id_; |
} |
-void ViewTreeClientImpl::SetBounds(Id view_id, const Rect& bounds) { |
+void ViewTreeClientImpl::SetBounds(Id view_id, const mojo::Rect& bounds) { |
DCHECK(tree_); |
tree_->SetViewBounds(view_id, bounds.Clone(), ActionCompletedCallback()); |
} |
@@ -159,34 +160,36 @@ void ViewTreeClientImpl::SetProperty(Id view_id, |
const std::string& name, |
const std::vector<uint8_t>& data) { |
DCHECK(tree_); |
- tree_->SetViewProperty(view_id, String(name), Array<uint8_t>::From(data), |
+ tree_->SetViewProperty(view_id, mojo::String(name), |
+ mojo::Array<uint8_t>::From(data), |
ActionCompletedCallback()); |
} |
void ViewTreeClientImpl::SetViewTextInputState(Id view_id, |
- TextInputStatePtr state) { |
+ mojo::TextInputStatePtr state) { |
DCHECK(tree_); |
tree_->SetViewTextInputState(view_id, state.Pass()); |
} |
void ViewTreeClientImpl::SetImeVisibility(Id view_id, |
bool visible, |
- TextInputStatePtr state) { |
+ mojo::TextInputStatePtr state) { |
DCHECK(tree_); |
tree_->SetImeVisibility(view_id, visible, state.Pass()); |
} |
void ViewTreeClientImpl::Embed(Id view_id, |
- ViewTreeClientPtr client, |
+ mojo::ViewTreeClientPtr client, |
uint32_t policy_bitmask, |
- const ViewTree::EmbedCallback& callback) { |
+ const mojo::ViewTree::EmbedCallback& callback) { |
DCHECK(tree_); |
tree_->Embed(view_id, client.Pass(), policy_bitmask, callback); |
} |
-void ViewTreeClientImpl::RequestSurface(Id view_id, |
- InterfaceRequest<Surface> surface, |
- SurfaceClientPtr client) { |
+void ViewTreeClientImpl::RequestSurface( |
+ Id view_id, |
+ mojo::InterfaceRequest<mojo::Surface> surface, |
+ mojo::SurfaceClientPtr client) { |
DCHECK(tree_); |
tree_->RequestSurface(view_id, surface.Pass(), client.Pass()); |
} |
@@ -220,8 +223,8 @@ void ViewTreeClientImpl::OnRootDestroyed(View* root) { |
Id ViewTreeClientImpl::CreateViewOnServer() { |
DCHECK(tree_); |
const Id view_id = MakeTransportId(connection_id_, ++next_id_); |
- tree_->CreateView(view_id, [this](ErrorCode code) { |
- OnActionCompleted(code == ERROR_CODE_NONE); |
+ tree_->CreateView(view_id, [this](mojo::ErrorCode code) { |
+ OnActionCompleted(code == mojo::ERROR_CODE_NONE); |
}); |
return view_id; |
} |
@@ -257,8 +260,8 @@ ConnectionSpecificId ViewTreeClientImpl::GetConnectionId() { |
// ViewTreeClientImpl, ViewTreeClient implementation: |
void ViewTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id, |
- ViewDataPtr root_data, |
- ViewTreePtr tree, |
+ mojo::ViewDataPtr root_data, |
+ mojo::ViewTreePtr tree, |
Id focused_view_id, |
uint32 access_policy) { |
if (tree) { |
@@ -293,8 +296,8 @@ void ViewTreeClientImpl::OnUnembed() { |
} |
void ViewTreeClientImpl::OnViewBoundsChanged(Id view_id, |
- RectPtr old_bounds, |
- RectPtr new_bounds) { |
+ mojo::RectPtr old_bounds, |
+ mojo::RectPtr new_bounds) { |
View* view = GetViewById(view_id); |
ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds); |
} |
@@ -302,8 +305,8 @@ void ViewTreeClientImpl::OnViewBoundsChanged(Id view_id, |
namespace { |
void SetViewportMetricsOnDecendants(View* root, |
- const ViewportMetrics& old_metrics, |
- const ViewportMetrics& new_metrics) { |
+ const mojo::ViewportMetrics& old_metrics, |
+ const mojo::ViewportMetrics& new_metrics) { |
ViewPrivate(root).LocalSetViewportMetrics(old_metrics, new_metrics); |
const View::Children& children = root->children(); |
for (size_t i = 0; i < children.size(); ++i) |
@@ -312,8 +315,8 @@ void SetViewportMetricsOnDecendants(View* root, |
} |
void ViewTreeClientImpl::OnViewViewportMetricsChanged( |
- ViewportMetricsPtr old_metrics, |
- ViewportMetricsPtr new_metrics) { |
+ mojo::ViewportMetricsPtr old_metrics, |
+ mojo::ViewportMetricsPtr new_metrics) { |
View* view = GetRoot(); |
if (view) |
SetViewportMetricsOnDecendants(view, *old_metrics, *new_metrics); |
@@ -323,7 +326,7 @@ void ViewTreeClientImpl::OnViewHierarchyChanged( |
Id view_id, |
Id new_parent_id, |
Id old_parent_id, |
- mojo::Array<ViewDataPtr> views) { |
+ mojo::Array<mojo::ViewDataPtr> views) { |
View* initial_parent = views.size() ? GetViewById(views[0]->parent_id) : NULL; |
const bool was_view_known = GetViewById(view_id) != nullptr; |
@@ -346,7 +349,7 @@ void ViewTreeClientImpl::OnViewHierarchyChanged( |
void ViewTreeClientImpl::OnViewReordered(Id view_id, |
Id relative_view_id, |
- OrderDirection direction) { |
+ mojo::OrderDirection direction) { |
View* view = GetViewById(view_id); |
View* relative_view = GetViewById(relative_view_id); |
if (view && relative_view) |
@@ -374,9 +377,10 @@ void ViewTreeClientImpl::OnViewDrawnStateChanged(Id view_id, bool drawn) { |
ViewPrivate(view).LocalSetDrawn(drawn); |
} |
-void ViewTreeClientImpl::OnViewSharedPropertyChanged(Id view_id, |
- const String& name, |
- Array<uint8_t> new_data) { |
+void ViewTreeClientImpl::OnViewSharedPropertyChanged( |
+ Id view_id, |
+ const mojo::String& name, |
+ mojo::Array<uint8_t> new_data) { |
View* view = GetViewById(view_id); |
if (view) { |
std::vector<uint8_t> data; |
@@ -392,8 +396,8 @@ void ViewTreeClientImpl::OnViewSharedPropertyChanged(Id view_id, |
void ViewTreeClientImpl::OnViewInputEvent( |
Id view_id, |
- EventPtr event, |
- const Callback<void()>& ack_callback) { |
+ mojo::EventPtr event, |
+ const mojo::Callback<void()>& ack_callback) { |
View* view = GetViewById(view_id); |
if (view) { |
FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view).observers(), |
@@ -427,8 +431,8 @@ void ViewTreeClientImpl::OnActionCompleted(bool success) { |
change_acked_callback_.Run(); |
} |
-Callback<void(bool)> ViewTreeClientImpl::ActionCompletedCallback() { |
+mojo::Callback<void(bool)> ViewTreeClientImpl::ActionCompletedCallback() { |
return [this](bool success) { OnActionCompleted(success); }; |
} |
-} // namespace mojo |
+} // namespace mus |