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

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

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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/window.cc
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc
index 4885537b47398550b758905c4da2953ea23171b5..ba6b77f77b740ee006a6744c0793f51e4d2d33eb 100644
--- a/components/mus/public/cpp/lib/window.cc
+++ b/components/mus/public/cpp/lib/window.cc
@@ -308,13 +308,13 @@ void Window::Reorder(Window* relative, mojom::OrderDirection direction) {
void Window::MoveToFront() {
if (!parent_ || parent_->children_.back() == this)
return;
- Reorder(parent_->children_.back(), mojom::ORDER_DIRECTION_ABOVE);
+ Reorder(parent_->children_.back(), mojom::OrderDirection::ABOVE);
}
void Window::MoveToBack() {
if (!parent_ || parent_->children_.front() == this)
return;
- Reorder(parent_->children_.front(), mojom::ORDER_DIRECTION_BELOW);
+ Reorder(parent_->children_.front(), mojom::OrderDirection::BELOW);
}
bool Window::Contains(Window* child) const {
@@ -368,7 +368,7 @@ void Window::SetTextInputState(mojo::TextInputStatePtr state) {
void Window::SetImeVisibility(bool visible, mojo::TextInputStatePtr state) {
// SetImeVisibility() shouldn't be used if the window is not editable.
- DCHECK(state.is_null() || state->type != mojo::TEXT_INPUT_TYPE_NONE);
+ DCHECK(state.is_null() || state->type != mojo::TextInputType::NONE);
if (connection_)
tree_client()->SetImeVisibility(id_, visible, std::move(state));
}
@@ -388,7 +388,7 @@ void Window::SetCanFocus(bool can_focus) {
}
void Window::Embed(mus::mojom::WindowTreeClientPtr client) {
- Embed(std::move(client), mus::mojom::WindowTree::ACCESS_POLICY_DEFAULT,
+ Embed(std::move(client), mus::mojom::WindowTree::kAccessPolicyDefault,
base::Bind(&EmptyEmbedCallback));
}
@@ -483,7 +483,7 @@ Window::Window(WindowTreeConnection* connection, Id id)
input_event_handler_(nullptr),
viewport_metrics_(CreateEmptyViewportMetrics()),
visible_(false),
- cursor_id_(mojom::CURSOR_NULL),
+ cursor_id_(mojom::Cursor::CURSOR_NULL),
drawn_(false) {}
WindowTreeClientImpl* Window::tree_client() {
@@ -791,15 +791,15 @@ bool Window::ReorderImpl(Window* window,
std::find(window->parent_->children_.begin(),
window->parent_->children_.end(), relative) -
window->parent_->children_.begin();
- if ((direction == mojom::ORDER_DIRECTION_ABOVE && child_i == target_i + 1) ||
- (direction == mojom::ORDER_DIRECTION_BELOW && child_i + 1 == target_i)) {
+ if ((direction == mojom::OrderDirection::ABOVE && child_i == target_i + 1) ||
+ (direction == mojom::OrderDirection::BELOW && child_i + 1 == target_i)) {
return false;
}
if (notifier)
notifier->NotifyWindowReordering();
- const size_t dest_i = direction == mojom::ORDER_DIRECTION_ABOVE
+ const size_t dest_i = direction == mojom::OrderDirection::ABOVE
? (child_i < target_i ? target_i : target_i + 1)
: (child_i < target_i ? target_i - 1 : target_i);
window->parent_->children_.erase(window->parent_->children_.begin() +
« no previous file with comments | « components/mus/public/cpp/lib/in_flight_change.h ('k') | components/mus/public/cpp/lib/window_tree_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698