OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 load_url_params->browser_initiated_post_data = | 287 load_url_params->browser_initiated_post_data = |
288 params->browser_initiated_post_data; | 288 params->browser_initiated_post_data; |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 void TabAndroid::SwapTabContents(content::WebContents* old_contents, | 292 void TabAndroid::SwapTabContents(content::WebContents* old_contents, |
293 content::WebContents* new_contents, | 293 content::WebContents* new_contents, |
294 bool did_start_load, | 294 bool did_start_load, |
295 bool did_finish_load) { | 295 bool did_finish_load) { |
296 JNIEnv* env = base::android::AttachCurrentThread(); | 296 JNIEnv* env = base::android::AttachCurrentThread(); |
297 | |
298 // We need to notify the native InfobarContainer so infobars can be swapped. | |
299 InfoBarContainerAndroid* infobar_container = | |
300 reinterpret_cast<InfoBarContainerAndroid*>( | |
301 Java_Tab_getNativeInfoBarContainer( | |
302 env, | |
303 weak_java_tab_.get(env).obj())); | |
304 InfoBarService* new_infobar_service = | |
305 new_contents ? InfoBarService::FromWebContents(new_contents) : NULL; | |
306 infobar_container->ChangeInfoBarManager(new_infobar_service); | |
307 | |
308 Java_Tab_swapWebContents( | 297 Java_Tab_swapWebContents( |
309 env, | 298 env, |
310 weak_java_tab_.get(env).obj(), | 299 weak_java_tab_.get(env).obj(), |
311 new_contents->GetJavaWebContents().obj(), | 300 new_contents->GetJavaWebContents().obj(), |
312 did_start_load, | 301 did_start_load, |
313 did_finish_load); | 302 did_finish_load); |
314 } | 303 } |
315 | 304 |
316 void TabAndroid::DefaultSearchProviderChanged( | 305 void TabAndroid::DefaultSearchProviderChanged( |
317 bool google_base_url_domain_changed) { | 306 bool google_base_url_domain_changed) { |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 // s^{n+1} / s^{n} = 2100 / 2000 | 866 // s^{n+1} / s^{n} = 2100 / 2000 |
878 // s = 1.05 | 867 // s = 1.05 |
879 // s^b = 60000 | 868 // s^b = 60000 |
880 // b = ln(60000) / ln(1.05) ~= 225 | 869 // b = ln(60000) / ln(1.05) ~= 225 |
881 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", | 870 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", |
882 base::Time::Now() - chrome::android::GetMainEntryPointTime(), | 871 base::Time::Now() - chrome::android::GetMainEntryPointTime(), |
883 base::TimeDelta::FromMilliseconds(1), | 872 base::TimeDelta::FromMilliseconds(1), |
884 base::TimeDelta::FromMinutes(1), | 873 base::TimeDelta::FromMinutes(1), |
885 225); | 874 225); |
886 } | 875 } |
OLD | NEW |