OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/tab_android.h" | 5 #include "chrome/browser/android/tab_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 NOTREACHED() << "Unexpected notification " << type; | 297 NOTREACHED() << "Unexpected notification " << type; |
298 break; | 298 break; |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 void TabAndroid::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, | 302 void TabAndroid::OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, |
303 NotificationIconType notification_icon_type, | 303 NotificationIconType notification_icon_type, |
304 const GURL& icon_url, | 304 const GURL& icon_url, |
305 bool icon_url_changed, | 305 bool icon_url_changed, |
306 const gfx::Image& image) { | 306 const gfx::Image& image) { |
307 if (notification_icon_type != NON_TOUCH_LARGEST && | 307 if (notification_icon_type != LARGEST) |
308 notification_icon_type != TOUCH_LARGEST) { | |
309 return; | 308 return; |
310 } | |
311 | 309 |
312 SkBitmap favicon = image.AsImageSkia().GetRepresentation(1.0f).sk_bitmap(); | 310 SkBitmap favicon = image.AsImageSkia().GetRepresentation(1.0f).sk_bitmap(); |
313 if (favicon.empty()) | 311 if (favicon.empty()) |
314 return; | 312 return; |
315 | 313 |
316 JNIEnv* env = base::android::AttachCurrentThread(); | 314 JNIEnv* env = base::android::AttachCurrentThread(); |
317 Java_Tab_onFaviconAvailable(env, weak_java_tab_.get(env), | 315 Java_Tab_onFaviconAvailable(env, weak_java_tab_.get(env), |
318 gfx::ConvertToJavaBitmap(&favicon)); | 316 gfx::ConvertToJavaBitmap(&favicon)); |
319 } | 317 } |
320 | 318 |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 798 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
801 TRACE_EVENT0("native", "TabAndroid::Init"); | 799 TRACE_EVENT0("native", "TabAndroid::Init"); |
802 // This will automatically bind to the Java object and pass ownership there. | 800 // This will automatically bind to the Java object and pass ownership there. |
803 new TabAndroid(env, obj); | 801 new TabAndroid(env, obj); |
804 } | 802 } |
805 | 803 |
806 // static | 804 // static |
807 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 805 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
808 return RegisterNativesImpl(env); | 806 return RegisterNativesImpl(env); |
809 } | 807 } |
OLD | NEW |