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

Unified Diff: examples/moterm_example_app/moterm_example_app.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
« no previous file with comments | « examples/keyboard_client/keyboard_client.cc ('k') | examples/native_run_app/native_run_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/moterm_example_app/moterm_example_app.cc
diff --git a/examples/moterm_example_app/moterm_example_app.cc b/examples/moterm_example_app/moterm_example_app.cc
index de5350cbf3fdec6d20a2d440887a12cc5bd509b7..94ccac18351b706afb1691c9f09bd203d2a53a3a 100644
--- a/examples/moterm_example_app/moterm_example_app.cc
+++ b/examples/moterm_example_app/moterm_example_app.cc
@@ -39,7 +39,7 @@ void Fputs(mojo::files::File* file, const char* s) {
mojo::Array<uint8_t> a(length);
memcpy(&a[0], s, length);
- file->Write(a.Pass(), 0, mojo::files::WHENCE_FROM_CURRENT,
+ file->Write(a.Pass(), 0, mojo::files::Whence::FROM_CURRENT,
mojo::files::File::WriteCallback());
}
@@ -67,7 +67,7 @@ class MotermExampleAppView : public mojo::ViewObserver {
void Resize() {
moterm_terminal_->SetSize(0, 0, false, [](mojo::files::Error error,
uint32_t rows, uint32_t columns) {
- DCHECK_EQ(error, mojo::files::ERROR_OK);
+ DCHECK_EQ(error, mojo::files::Error::OK);
DVLOG(1) << "New size: " << rows << "x" << columns;
});
}
@@ -76,7 +76,7 @@ class MotermExampleAppView : public mojo::ViewObserver {
if (!moterm_file_) {
moterm_terminal_->Connect(GetProxy(&moterm_file_), false,
[](mojo::files::Error error) {
- DCHECK_EQ(error, mojo::files::ERROR_OK);
+ DCHECK_EQ(error, mojo::files::Error::OK);
});
}
@@ -89,13 +89,13 @@ class MotermExampleAppView : public mojo::ViewObserver {
}
Fputs(moterm_file_.get(), "\x1b[0m\nWhere do you want to go today?\n:) ");
- moterm_file_->Read(1000, 0, mojo::files::WHENCE_FROM_CURRENT,
+ moterm_file_->Read(1000, 0, mojo::files::Whence::FROM_CURRENT,
base::Bind(&MotermExampleAppView::OnInputFromPrompt,
weak_factory_.GetWeakPtr()));
}
void OnInputFromPrompt(mojo::files::Error error,
mojo::Array<uint8_t> bytes_read) {
- if (error != mojo::files::ERROR_OK || !bytes_read) {
+ if (error != mojo::files::Error::OK || !bytes_read) {
// TODO(vtl): Handle errors?
NOTIMPLEMENTED();
return;
@@ -131,7 +131,7 @@ class MotermExampleAppView : public mojo::ViewObserver {
void OnDestinationDone(mojo::files::Error error) {
// We should always succeed. (It'll only fail on synchronous failures, which
// only occur when it's busy.)
- DCHECK_EQ(error, mojo::files::ERROR_OK);
+ DCHECK_EQ(error, mojo::files::Error::OK);
StartPrompt(false);
}
« no previous file with comments | « examples/keyboard_client/keyboard_client.cc ('k') | examples/native_run_app/native_run_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698