Index: mojo/services/view_manager/cpp/lib/view.cc |
diff --git a/mojo/services/view_manager/public/cpp/lib/view.cc b/mojo/services/view_manager/cpp/lib/view.cc |
similarity index 87% |
rename from mojo/services/view_manager/public/cpp/lib/view.cc |
rename to mojo/services/view_manager/cpp/lib/view.cc |
index 5b11fe40d8b3ff73efd6b4c3482e9cd75da4197a..a42fa1285c2b9a1de36acd8f821fd310a61ff893 100644 |
--- a/mojo/services/view_manager/public/cpp/lib/view.cc |
+++ b/mojo/services/view_manager/cpp/lib/view.cc |
@@ -2,16 +2,16 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "view_manager/public/cpp/view.h" |
+#include "view_manager/cpp/view.h" |
#include <set> |
#include <string> |
#include "mojo/public/cpp/application/service_provider_impl.h" |
-#include "view_manager/public/cpp/lib/view_manager_client_impl.h" |
-#include "view_manager/public/cpp/lib/view_private.h" |
-#include "view_manager/public/cpp/view_observer.h" |
-#include "view_manager/public/cpp/view_tracker.h" |
+#include "view_manager/cpp/lib/view_manager_client_impl.h" |
+#include "view_manager/cpp/lib/view_private.h" |
+#include "view_manager/cpp/view_observer.h" |
+#include "view_manager/cpp/view_tracker.h" |
namespace mojo { |
@@ -24,37 +24,32 @@ void NotifyViewTreeChangeAtReceiver( |
ViewObserver::TreeChangeParams local_params = params; |
local_params.receiver = receiver; |
if (change_applied) { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(receiver).observers(), |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(receiver).observers(), |
OnTreeChanged(local_params)); |
} else { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(receiver).observers(), |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(receiver).observers(), |
OnTreeChanging(local_params)); |
} |
} |
-void NotifyViewTreeChangeUp( |
- View* start_at, |
- const ViewObserver::TreeChangeParams& params, |
- bool change_applied) { |
+void NotifyViewTreeChangeUp(View* start_at, |
+ const ViewObserver::TreeChangeParams& params, |
+ bool change_applied) { |
for (View* current = start_at; current; current = current->parent()) |
NotifyViewTreeChangeAtReceiver(current, params, change_applied); |
} |
-void NotifyViewTreeChangeDown( |
- View* start_at, |
- const ViewObserver::TreeChangeParams& params, |
- bool change_applied) { |
+void NotifyViewTreeChangeDown(View* start_at, |
+ const ViewObserver::TreeChangeParams& params, |
+ bool change_applied) { |
NotifyViewTreeChangeAtReceiver(start_at, params, change_applied); |
View::Children::const_iterator it = start_at->children().begin(); |
for (; it != start_at->children().end(); ++it) |
NotifyViewTreeChangeDown(*it, params, change_applied); |
} |
-void NotifyViewTreeChange( |
- const ViewObserver::TreeChangeParams& params, |
- bool change_applied) { |
+void NotifyViewTreeChange(const ViewObserver::TreeChangeParams& params, |
+ bool change_applied) { |
NotifyViewTreeChangeDown(params.target, params, change_applied); |
if (params.old_parent) |
NotifyViewTreeChangeUp(params.old_parent, params, change_applied); |
@@ -70,9 +65,7 @@ class ScopedTreeNotifier { |
params_.new_parent = new_parent; |
NotifyViewTreeChange(params_, false); |
} |
- ~ScopedTreeNotifier() { |
- NotifyViewTreeChange(params_, true); |
- } |
+ ~ScopedTreeNotifier() { NotifyViewTreeChange(params_, true); } |
private: |
ViewObserver::TreeChangeParams params_; |
@@ -94,16 +87,12 @@ class ScopedOrderChangedNotifier { |
ScopedOrderChangedNotifier(View* view, |
View* relative_view, |
OrderDirection direction) |
- : view_(view), |
- relative_view_(relative_view), |
- direction_(direction) { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(view_).observers(), |
+ : view_(view), relative_view_(relative_view), direction_(direction) { |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view_).observers(), |
OnViewReordering(view_, relative_view_, direction_)); |
} |
~ScopedOrderChangedNotifier() { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(view_).observers(), |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view_).observers(), |
OnViewReordered(view_, relative_view_, direction_)); |
} |
@@ -150,16 +139,12 @@ class ScopedSetBoundsNotifier { |
ScopedSetBoundsNotifier(View* view, |
const Rect& old_bounds, |
const Rect& new_bounds) |
- : view_(view), |
- old_bounds_(old_bounds), |
- new_bounds_(new_bounds) { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(view_).observers(), |
+ : view_(view), old_bounds_(old_bounds), new_bounds_(new_bounds) { |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view_).observers(), |
OnViewBoundsChanging(view_, old_bounds_, new_bounds_)); |
} |
~ScopedSetBoundsNotifier() { |
- FOR_EACH_OBSERVER(ViewObserver, |
- *ViewPrivate(view_).observers(), |
+ FOR_EACH_OBSERVER(ViewObserver, *ViewPrivate(view_).observers(), |
OnViewBoundsChanged(view_, old_bounds_, new_bounds_)); |
} |
@@ -174,7 +159,7 @@ class ScopedSetBoundsNotifier { |
// Some operations are only permitted in the connection that created the view. |
bool OwnsView(ViewManager* manager, View* view) { |
return !manager || |
- static_cast<ViewManagerClientImpl*>(manager)->OwnsView(view->id()); |
+ static_cast<ViewManagerClientImpl*>(manager)->OwnsView(view->id()); |
} |
} // namespace |
@@ -254,8 +239,8 @@ void View::SetSharedProperty(const std::string& name, |
if (value->size()) |
memcpy(&transport_value.front(), &(value->front()), value->size()); |
} |
- static_cast<ViewManagerClientImpl*>(manager_)->SetProperty( |
- id_, name, transport_value.Pass()); |
+ static_cast<ViewManagerClientImpl*>(manager_) |
+ ->SetProperty(id_, name, transport_value.Pass()); |
} |
FOR_EACH_OBSERVER( |
@@ -301,8 +286,8 @@ void View::RemoveChild(View* child) { |
CHECK_EQ(child->view_manager(), manager_); |
LocalRemoveChild(child); |
if (manager_) { |
- static_cast<ViewManagerClientImpl*>(manager_)->RemoveChild(child->id(), |
- id_); |
+ static_cast<ViewManagerClientImpl*>(manager_) |
+ ->RemoveChild(child->id(), id_); |
} |
} |
@@ -322,9 +307,8 @@ void View::Reorder(View* relative, OrderDirection direction) { |
if (!LocalReorder(relative, direction)) |
return; |
if (manager_) { |
- static_cast<ViewManagerClientImpl*>(manager_)->Reorder(id_, |
- relative->id(), |
- direction); |
+ static_cast<ViewManagerClientImpl*>(manager_) |
+ ->Reorder(id_, relative->id(), direction); |
} |
} |
@@ -406,8 +390,7 @@ View::View() |
parent_(NULL), |
viewport_metrics_(CreateEmptyViewportMetrics()), |
visible_(true), |
- drawn_(false) { |
-} |
+ drawn_(false) {} |
View::~View() { |
FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDestroying(this)); |
@@ -446,8 +429,7 @@ View::View(ViewManager* manager, Id id) |
parent_(nullptr), |
viewport_metrics_(CreateEmptyViewportMetrics()), |
visible_(false), |
- drawn_(false) { |
-} |
+ drawn_(false) {} |
int64 View::SetLocalPropertyInternal(const void* key, |
const char* name, |
@@ -499,8 +481,7 @@ bool View::LocalReorder(View* relative, OrderDirection direction) { |
return ReorderImpl(&parent_->children_, this, relative, direction); |
} |
-void View::LocalSetBounds(const Rect& old_bounds, |
- const Rect& new_bounds) { |
+void View::LocalSetBounds(const Rect& old_bounds, const Rect& new_bounds) { |
DCHECK(old_bounds.x == bounds_.x); |
DCHECK(old_bounds.y == bounds_.y); |
DCHECK(old_bounds.width == bounds_.width); |
@@ -544,7 +525,7 @@ void View::LocalSetVisible(bool visible) { |
void View::NotifyViewVisibilityChanged(View* target) { |
if (!NotifyViewVisibilityChangedDown(target)) { |
- return; // |this| has been deleted. |
+ return; // |this| has been deleted. |
} |
NotifyViewVisibilityChangedUp(target); |
} |
@@ -561,7 +542,7 @@ bool View::NotifyViewVisibilityChangedAtReceiver(View* target) { |
bool View::NotifyViewVisibilityChangedDown(View* target) { |
if (!NotifyViewVisibilityChangedAtReceiver(target)) |
- return false; // |this| was deleted. |
+ return false; // |this| was deleted. |
std::set<const View*> child_already_processed; |
bool child_destroyed = false; |
do { |