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

Unified Diff: samples/android_sample/jni/eventloop.cc

Issue 11416343: Refactored Android samples / embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type error on playBackground Created 8 years 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 | « samples/android_sample/jni/dart_host.cc ('k') | samples/android_sample/jni/graphics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/android_sample/jni/eventloop.cc
diff --git a/samples/android_sample/jni/eventloop.cc b/samples/android_sample/jni/eventloop.cc
index ae6a4ef75e59edda63d3d85d328468b6d861700b..b6e3851fccacbb657187f6c252b34098e1832886 100644
--- a/samples/android_sample/jni/eventloop.cc
+++ b/samples/android_sample/jni/eventloop.cc
@@ -1,5 +1,9 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
#include "jni/eventloop.h"
-#include "bin/log.h"
+#include "jni/log.h"
EventLoop::EventLoop(android_app* application)
: enabled_(false),
@@ -21,7 +25,7 @@ void EventLoop::Run(ActivityHandler* activity_handler,
app_dummy();
activity_handler_ = activity_handler;
input_handler_ = context->input_handler;
- Log::Print("Starting event loop");
+ LOGI("Starting event loop");
while (true) {
// If not enabled, block on events. If enabled, don't block
// so we can do useful work in onStep.
@@ -37,7 +41,7 @@ void EventLoop::Run(ActivityHandler* activity_handler,
}
}
if (enabled_ && !quit_) {
- Log::Print("step");
+ LOGI("step");
if (activity_handler_->OnStep() != 0) {
quit_ = true;
ANativeActivity_finish(application_->activity);
@@ -48,7 +52,7 @@ void EventLoop::Run(ActivityHandler* activity_handler,
// Called when we gain focus.
void EventLoop::Activate() {
- Log::Print("activate");
+ LOGI("activate");
if (!enabled_ && application_->window != NULL) {
quit_ = false;
enabled_ = true;
@@ -61,7 +65,7 @@ void EventLoop::Activate() {
// Called when we lose focus.
void EventLoop::Deactivate() {
- Log::Print("deactivate");
+ LOGI("deactivate");
if (enabled_) {
activity_handler_->OnDeactivate();
enabled_ = false;
@@ -118,7 +122,7 @@ void EventLoop::ProcessActivityEvent(int32_t command) {
int32_t EventLoop::ProcessInputEvent(AInputEvent* event) {
int32_t event_type = AInputEvent_getType(event);
- Log::Print("Got input event type %d", event_type);
+ LOGI("Got input event type %d", event_type);
switch (event_type) {
case AINPUT_EVENT_TYPE_MOTION:
if (AInputEvent_getSource(event) == AINPUT_SOURCE_TOUCHSCREEN) {
@@ -141,4 +145,3 @@ int32_t EventLoop::InputCallback(android_app* application,
EventLoop* event_loop = reinterpret_cast<EventLoop*>(application->userData);
return event_loop->ProcessInputEvent(event);
}
-
« no previous file with comments | « samples/android_sample/jni/dart_host.cc ('k') | samples/android_sample/jni/graphics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698