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

Unified Diff: mojo/services/view_manager/public/cpp/lib/view.cc

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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: mojo/services/view_manager/public/cpp/lib/view.cc
diff --git a/mojo/services/view_manager/public/cpp/lib/view.cc b/mojo/services/view_manager/public/cpp/lib/view.cc
index ff9ce1d3264b252dd4256920408b531b11d8be1f..5b11fe40d8b3ff73efd6b4c3482e9cd75da4197a 100644
--- a/mojo/services/view_manager/public/cpp/lib/view.cc
+++ b/mojo/services/view_manager/public/cpp/lib/view.cc
@@ -129,14 +129,14 @@ bool ReorderImpl(View::Children* children,
const size_t target_i =
std::find(children->begin(), children->end(), relative) -
children->begin();
- if ((direction == ORDER_DIRECTION_ABOVE && child_i == target_i + 1) ||
- (direction == ORDER_DIRECTION_BELOW && child_i + 1 == target_i)) {
+ if ((direction == OrderDirection::ABOVE && child_i == target_i + 1) ||
+ (direction == OrderDirection::BELOW && child_i + 1 == target_i)) {
return false;
}
ScopedOrderChangedNotifier notifier(view, relative, direction);
- const size_t dest_i = direction == ORDER_DIRECTION_ABOVE
+ const size_t dest_i = direction == OrderDirection::ABOVE
? (child_i < target_i ? target_i : target_i + 1)
: (child_i < target_i ? target_i - 1 : target_i);
children->erase(children->begin() + child_i);
@@ -309,13 +309,13 @@ void View::RemoveChild(View* child) {
void View::MoveToFront() {
if (!parent_ || parent_->children_.back() == this)
return;
- Reorder(parent_->children_.back(), ORDER_DIRECTION_ABOVE);
+ Reorder(parent_->children_.back(), OrderDirection::ABOVE);
}
void View::MoveToBack() {
if (!parent_ || parent_->children_.front() == this)
return;
- Reorder(parent_->children_.front(), ORDER_DIRECTION_BELOW);
+ Reorder(parent_->children_.front(), OrderDirection::BELOW);
}
void View::Reorder(View* relative, OrderDirection direction) {

Powered by Google App Engine
This is Rietveld 408576698