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

Unified Diff: components/mus/public/cpp/lib/view_tree_client_impl.cc

Issue 1351013002: Revert of Mandoline UI Process: Update namespaces and file names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: 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 43a19353c72494b9515bdac7bf988dc550fef84a..ceac2ee88367793be189e8be53b521b97759145f 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 mus {
+namespace mojo {
Id MakeTransportId(ConnectionSpecificId connection_id,
ConnectionSpecificId local_id) {
@@ -24,7 +24,7 @@
// Helper called to construct a local view object from transport data.
View* AddViewToConnection(ViewTreeClientImpl* client,
View* parent,
- const mojo::ViewDataPtr& view_data) {
+ const 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 @@
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(mojo::ViewportMetrics(),
+ private_view.LocalSetViewportMetrics(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(mojo::Rect(), *view_data->bounds);
+ private_view.LocalSetBounds(Rect(), *view_data->bounds);
if (parent)
ViewPrivate(parent).LocalAddChild(view);
return view;
}
View* BuildViewTree(ViewTreeClientImpl* client,
- const mojo::Array<mojo::ViewDataPtr>& views,
+ const Array<ViewDataPtr>& views,
View* initial_parent) {
std::vector<View*> parents;
View* root = NULL;
@@ -70,13 +70,12 @@
ViewTreeConnection* ViewTreeConnection::Create(
ViewTreeDelegate* delegate,
- mojo::InterfaceRequest<mojo::ViewTreeClient> request) {
+ InterfaceRequest<ViewTreeClient> request) {
return new ViewTreeClientImpl(delegate, request.Pass());
}
-ViewTreeClientImpl::ViewTreeClientImpl(
- ViewTreeDelegate* delegate,
- mojo::InterfaceRequest<mojo::ViewTreeClient> request)
+ViewTreeClientImpl::ViewTreeClientImpl(ViewTreeDelegate* delegate,
+ InterfaceRequest<ViewTreeClient> request)
: connection_id_(0),
next_id_(1),
delegate_(delegate),
@@ -129,7 +128,7 @@
void ViewTreeClientImpl::Reorder(Id view_id,
Id relative_view_id,
- mojo::OrderDirection direction) {
+ OrderDirection direction) {
DCHECK(tree_);
tree_->ReorderView(view_id, relative_view_id, direction,
ActionCompletedCallback());
@@ -139,7 +138,7 @@
return HiWord(id) == connection_id_;
}
-void ViewTreeClientImpl::SetBounds(Id view_id, const mojo::Rect& bounds) {
+void ViewTreeClientImpl::SetBounds(Id view_id, const Rect& bounds) {
DCHECK(tree_);
tree_->SetViewBounds(view_id, bounds.Clone(), ActionCompletedCallback());
}
@@ -160,36 +159,34 @@
const std::string& name,
const std::vector<uint8_t>& data) {
DCHECK(tree_);
- tree_->SetViewProperty(view_id, mojo::String(name),
- mojo::Array<uint8_t>::From(data),
+ tree_->SetViewProperty(view_id, String(name), Array<uint8_t>::From(data),
ActionCompletedCallback());
}
void ViewTreeClientImpl::SetViewTextInputState(Id view_id,
- mojo::TextInputStatePtr state) {
+ TextInputStatePtr state) {
DCHECK(tree_);
tree_->SetViewTextInputState(view_id, state.Pass());
}
void ViewTreeClientImpl::SetImeVisibility(Id view_id,
bool visible,
- mojo::TextInputStatePtr state) {
+ TextInputStatePtr state) {
DCHECK(tree_);
tree_->SetImeVisibility(view_id, visible, state.Pass());
}
void ViewTreeClientImpl::Embed(Id view_id,
- mojo::ViewTreeClientPtr client,
+ ViewTreeClientPtr client,
uint32_t policy_bitmask,
- const mojo::ViewTree::EmbedCallback& callback) {
+ const ViewTree::EmbedCallback& callback) {
DCHECK(tree_);
tree_->Embed(view_id, client.Pass(), policy_bitmask, callback);
}
-void ViewTreeClientImpl::RequestSurface(
- Id view_id,
- mojo::InterfaceRequest<mojo::Surface> surface,
- mojo::SurfaceClientPtr client) {
+void ViewTreeClientImpl::RequestSurface(Id view_id,
+ InterfaceRequest<Surface> surface,
+ SurfaceClientPtr client) {
DCHECK(tree_);
tree_->RequestSurface(view_id, surface.Pass(), client.Pass());
}
@@ -223,8 +220,8 @@
Id ViewTreeClientImpl::CreateViewOnServer() {
DCHECK(tree_);
const Id view_id = MakeTransportId(connection_id_, ++next_id_);
- tree_->CreateView(view_id, [this](mojo::ErrorCode code) {
- OnActionCompleted(code == mojo::ERROR_CODE_NONE);
+ tree_->CreateView(view_id, [this](ErrorCode code) {
+ OnActionCompleted(code == ERROR_CODE_NONE);
});
return view_id;
}
@@ -260,8 +257,8 @@
// ViewTreeClientImpl, ViewTreeClient implementation:
void ViewTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id,
- mojo::ViewDataPtr root_data,
- mojo::ViewTreePtr tree,
+ ViewDataPtr root_data,
+ ViewTreePtr tree,
Id focused_view_id,
uint32 access_policy) {
if (tree) {
@@ -296,8 +293,8 @@
}
void ViewTreeClientImpl::OnViewBoundsChanged(Id view_id,
- mojo::RectPtr old_bounds,
- mojo::RectPtr new_bounds) {
+ RectPtr old_bounds,
+ RectPtr new_bounds) {
View* view = GetViewById(view_id);
ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds);
}
@@ -305,8 +302,8 @@
namespace {
void SetViewportMetricsOnDecendants(View* root,
- const mojo::ViewportMetrics& old_metrics,
- const mojo::ViewportMetrics& new_metrics) {
+ const ViewportMetrics& old_metrics,
+ const 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)
@@ -315,8 +312,8 @@
}
void ViewTreeClientImpl::OnViewViewportMetricsChanged(
- mojo::ViewportMetricsPtr old_metrics,
- mojo::ViewportMetricsPtr new_metrics) {
+ ViewportMetricsPtr old_metrics,
+ ViewportMetricsPtr new_metrics) {
View* view = GetRoot();
if (view)
SetViewportMetricsOnDecendants(view, *old_metrics, *new_metrics);
@@ -326,7 +323,7 @@
Id view_id,
Id new_parent_id,
Id old_parent_id,
- mojo::Array<mojo::ViewDataPtr> views) {
+ mojo::Array<ViewDataPtr> views) {
View* initial_parent = views.size() ? GetViewById(views[0]->parent_id) : NULL;
const bool was_view_known = GetViewById(view_id) != nullptr;
@@ -349,7 +346,7 @@
void ViewTreeClientImpl::OnViewReordered(Id view_id,
Id relative_view_id,
- mojo::OrderDirection direction) {
+ OrderDirection direction) {
View* view = GetViewById(view_id);
View* relative_view = GetViewById(relative_view_id);
if (view && relative_view)
@@ -377,10 +374,9 @@
ViewPrivate(view).LocalSetDrawn(drawn);
}
-void ViewTreeClientImpl::OnViewSharedPropertyChanged(
- Id view_id,
- const mojo::String& name,
- mojo::Array<uint8_t> new_data) {
+void ViewTreeClientImpl::OnViewSharedPropertyChanged(Id view_id,
+ const String& name,
+ Array<uint8_t> new_data) {
View* view = GetViewById(view_id);
if (view) {
std::vector<uint8_t> data;
@@ -396,8 +392,8 @@
void ViewTreeClientImpl::OnViewInputEvent(
Id view_id,
- mojo::EventPtr event,
- const mojo::Callback<void()>& ack_callback) {
+ EventPtr event,
+ const Callback<void()>& ack_callback) {
View* view = GetViewById(view_id);
if (view) {
FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view).observers(),
@@ -431,8 +427,8 @@
change_acked_callback_.Run();
}
-mojo::Callback<void(bool)> ViewTreeClientImpl::ActionCompletedCallback() {
+Callback<void(bool)> ViewTreeClientImpl::ActionCompletedCallback() {
return [this](bool success) { OnActionCompleted(success); };
}
-} // namespace mus
+} // namespace mojo
« no previous file with comments | « components/mus/public/cpp/lib/view_tree_client_impl.h ('k') | components/mus/public/cpp/lib/view_tree_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698