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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 2773273002: Last_n: do not save snapshot of custom tabs. (Closed)
Patch Set: Renamed method; added custom tab checks to tests. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 SkBitmap favicon = image.AsImageSkia().GetRepresentation(1.0f).sk_bitmap(); 312 SkBitmap favicon = image.AsImageSkia().GetRepresentation(1.0f).sk_bitmap();
313 if (favicon.empty()) 313 if (favicon.empty())
314 return; 314 return;
315 315
316 JNIEnv* env = base::android::AttachCurrentThread(); 316 JNIEnv* env = base::android::AttachCurrentThread();
317 Java_Tab_onFaviconAvailable(env, weak_java_tab_.get(env), 317 Java_Tab_onFaviconAvailable(env, weak_java_tab_.get(env),
318 gfx::ConvertToJavaBitmap(&favicon)); 318 gfx::ConvertToJavaBitmap(&favicon));
319 } 319 }
320 320
321 bool TabAndroid::IsCurrentlyACustomTab() {
322 JNIEnv* env = base::android::AttachCurrentThread();
323 return Java_Tab_isCurrentlyACustomTab(env, weak_java_tab_.get(env));
324 }
325
321 void TabAndroid::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { 326 void TabAndroid::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) {
322 delete this; 327 delete this;
323 } 328 }
324 329
325 void TabAndroid::InitWebContents( 330 void TabAndroid::InitWebContents(
326 JNIEnv* env, 331 JNIEnv* env,
327 const JavaParamRef<jobject>& obj, 332 const JavaParamRef<jobject>& obj,
328 jboolean incognito, 333 jboolean incognito,
329 const JavaParamRef<jobject>& jweb_contents, 334 const JavaParamRef<jobject>& jweb_contents,
330 const JavaParamRef<jobject>& jweb_contents_delegate, 335 const JavaParamRef<jobject>& jweb_contents_delegate,
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 800 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
796 TRACE_EVENT0("native", "TabAndroid::Init"); 801 TRACE_EVENT0("native", "TabAndroid::Init");
797 // This will automatically bind to the Java object and pass ownership there. 802 // This will automatically bind to the Java object and pass ownership there.
798 new TabAndroid(env, obj); 803 new TabAndroid(env, obj);
799 } 804 }
800 805
801 // static 806 // static
802 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 807 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
803 return RegisterNativesImpl(env); 808 return RegisterNativesImpl(env);
804 } 809 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698