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

Unified Diff: mojo/services/native_viewport/native_viewport_android.cc

Issue 404913002: Break dependency of native_viewport_service on mojo::shell::Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move call to GetApplicationContext() to native_viewport_android Created 6 years, 5 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/native_viewport/native_viewport_android.cc
diff --git a/mojo/services/native_viewport/native_viewport_android.cc b/mojo/services/native_viewport/native_viewport_android.cc
index 1763f170ad307617f906427f3cf0f6ec931f0880..b9d9baaee9827c0a069639687109ded139ef24c0 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -9,7 +9,6 @@
#include "base/android/jni_android.h"
#include "jni/NativeViewportAndroid_jni.h"
-#include "mojo/shell/context.h"
#include "ui/events/event.h"
#include "ui/gfx/point.h"
@@ -38,10 +37,8 @@ bool NativeViewportAndroid::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
-NativeViewportAndroid::NativeViewportAndroid(shell::Context* context,
- NativeViewportDelegate* delegate)
+NativeViewportAndroid::NativeViewportAndroid(NativeViewportDelegate* delegate)
: delegate_(delegate),
- context_(context),
window_(NULL),
id_generator_(0),
weak_factory_(this) {
@@ -103,8 +100,10 @@ bool NativeViewportAndroid::TouchEvent(JNIEnv* env, jobject obj,
void NativeViewportAndroid::Init(const gfx::Rect& bounds) {
JNIEnv* env = base::android::AttachCurrentThread();
- Java_NativeViewportAndroid_createForActivity(env, context_->activity(),
- reinterpret_cast<jlong>(this));
+ Java_NativeViewportAndroid_createForActivity(
+ env,
+ base::android::GetApplicationContext(),
+ reinterpret_cast<jlong>(this));
}
void NativeViewportAndroid::Show() {
@@ -151,10 +150,8 @@ void NativeViewportAndroid::ReleaseWindow() {
// static
scoped_ptr<NativeViewport> NativeViewport::Create(
- shell::Context* context,
NativeViewportDelegate* delegate) {
- return scoped_ptr<NativeViewport>(
- new NativeViewportAndroid(context, delegate)).Pass();
+ return scoped_ptr<NativeViewport>(new NativeViewportAndroid(delegate)).Pass();
}
} // namespace services
« no previous file with comments | « mojo/services/native_viewport/native_viewport_android.h ('k') | mojo/services/native_viewport/native_viewport_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698