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

Unified Diff: ui/android/view_android.cc

Issue 2708703004: Reland "Refactor ContentViewClient (4/6)" (Closed)
Patch Set: rebased Created 3 years, 10 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 | « ui/android/view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/view_android.cc
diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc
index 251c16551cdbd672bd873cf0a2627f6325c258d9..1d5b146653458a83b93c58810f743f6df78e5c46 100644
--- a/ui/android/view_android.cc
+++ b/ui/android/view_android.cc
@@ -7,14 +7,17 @@
#include <algorithm>
#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
#include "cc/layers/layer.h"
#include "jni/ViewAndroidDelegate_jni.h"
#include "ui/android/window_android.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
+#include "url/gurl.h"
namespace ui {
+using base::android::ConvertUTF8ToJavaString;
using base::android::JavaRef;
using base::android::ScopedJavaLocalRef;
@@ -184,4 +187,44 @@ bool ViewAndroid::StartDragAndDrop(const JavaRef<jstring>& jtext,
jimage);
}
+void ViewAndroid::OnBackgroundColorChanged(unsigned int color) {
+ ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate());
+ if (delegate.is_null())
+ return;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_ViewAndroidDelegate_onBackgroundColorChanged(env, delegate, color);
+}
+
+void ViewAndroid::OnTopControlsChanged(float top_controls_offset,
+ float top_content_offset) {
+ ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate());
+ if (delegate.is_null())
+ return;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_ViewAndroidDelegate_onTopControlsChanged(
+ env, delegate, top_controls_offset, top_content_offset);
+}
+
+void ViewAndroid::OnBottomControlsChanged(float bottom_controls_offset,
+ float bottom_content_offset) {
+ ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate());
+ if (delegate.is_null())
+ return;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_ViewAndroidDelegate_onBottomControlsChanged(
+ env, delegate, bottom_controls_offset, bottom_content_offset);
+}
+
+void ViewAndroid::StartContentIntent(const GURL& content_url,
+ bool is_main_frame) {
+ ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate());
+ if (delegate.is_null())
+ return;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> jcontent_url =
+ ConvertUTF8ToJavaString(env, content_url.spec());
+ Java_ViewAndroidDelegate_onStartContentIntent(env, delegate, jcontent_url,
+ is_main_frame);
+}
+
} // namespace ui
« no previous file with comments | « ui/android/view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698