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

Unified Diff: runtime/embedders/android/main.cc

Issue 11467028: Migrate files to embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review fixes Created 7 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
« no previous file with comments | « runtime/embedders/android/log.h ('k') | runtime/embedders/android/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/embedders/android/main.cc
diff --git a/runtime/embedders/android/main.cc b/runtime/embedders/android/main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5fff9976fed36fc741b6ce8b42b48fe2aa1fcfad
--- /dev/null
+++ b/runtime/embedders/android/main.cc
@@ -0,0 +1,39 @@
+// 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 "embedders/android/context.h"
+#include "embedders/android/dart_host.h"
+#include "embedders/android/eventloop.h"
+#include "embedders/android/graphics.h"
+#include "embedders/android/input_service.h"
+#include "embedders/android/vm_glue.h"
+
+SoundService* psound_service;
+
+void android_main(android_app* application) {
+ Timer timer;
+ Graphics graphics(application, &timer);
+ VMGlue vmGlue(&graphics);
+ InputService inputService(application, &vmGlue,
+ graphics.width(), graphics.height());
+ SoundService sound_service(application);
+ psound_service = &sound_service;
+ Context context;
+ context.graphics = &graphics;
+ context.input_handler = &inputService;
+ context.sound_service = psound_service;
+ context.timer = &timer;
+ context.vm_glue = &vmGlue;
+ EventLoop eventLoop(application);
+ DartHost host(&context);
+ eventLoop.Run(&host, &context);
+}
+
+void PlayBackground(const char* path) {
+ psound_service->PlayBackground(path);
+}
+
+void StopBackground() {
+ psound_service->StopBackground();
+}
« no previous file with comments | « runtime/embedders/android/log.h ('k') | runtime/embedders/android/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698