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 NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; | 287 NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; |
288 load_url_params->browser_initiated_post_data = | 288 load_url_params->browser_initiated_post_data = |
289 params->browser_initiated_post_data; | 289 params->browser_initiated_post_data; |
290 } | 290 } |
291 } | 291 } |
292 | 292 |
293 void TabAndroid::SwapTabContents(content::WebContents* old_contents, | 293 void TabAndroid::SwapTabContents(content::WebContents* old_contents, |
294 content::WebContents* new_contents, | 294 content::WebContents* new_contents, |
295 bool did_start_load, | 295 bool did_start_load, |
296 bool did_finish_load) { | 296 bool did_finish_load) { |
| 297 #if !defined(USE_AURA) |
297 JNIEnv* env = base::android::AttachCurrentThread(); | 298 JNIEnv* env = base::android::AttachCurrentThread(); |
298 Java_Tab_swapWebContents( | 299 Java_Tab_swapWebContents( |
299 env, | 300 env, |
300 weak_java_tab_.get(env).obj(), | 301 weak_java_tab_.get(env).obj(), |
301 new_contents->GetJavaWebContents().obj(), | 302 new_contents->GetJavaWebContents().obj(), |
302 did_start_load, | 303 did_start_load, |
303 did_finish_load); | 304 did_finish_load); |
| 305 #endif |
304 } | 306 } |
305 | 307 |
306 void TabAndroid::DefaultSearchProviderChanged( | 308 void TabAndroid::DefaultSearchProviderChanged( |
307 bool google_base_url_domain_changed) { | 309 bool google_base_url_domain_changed) { |
308 // TODO(kmadhusu): Move this function definition to a common place and update | 310 // TODO(kmadhusu): Move this function definition to a common place and update |
309 // BrowserInstantController::DefaultSearchProviderChanged to use the same. | 311 // BrowserInstantController::DefaultSearchProviderChanged to use the same. |
310 if (!web_contents()) | 312 if (!web_contents()) |
311 return; | 313 return; |
312 | 314 |
313 InstantService* instant_service = | 315 InstantService* instant_service = |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 // s^{n+1} / s^{n} = 2100 / 2000 | 882 // s^{n+1} / s^{n} = 2100 / 2000 |
881 // s = 1.05 | 883 // s = 1.05 |
882 // s^b = 60000 | 884 // s^b = 60000 |
883 // b = ln(60000) / ln(1.05) ~= 225 | 885 // b = ln(60000) / ln(1.05) ~= 225 |
884 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", | 886 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", |
885 base::Time::Now() - chrome::android::GetMainEntryPointTime(), | 887 base::Time::Now() - chrome::android::GetMainEntryPointTime(), |
886 base::TimeDelta::FromMilliseconds(1), | 888 base::TimeDelta::FromMilliseconds(1), |
887 base::TimeDelta::FromMinutes(1), | 889 base::TimeDelta::FromMinutes(1), |
888 225); | 890 225); |
889 } | 891 } |
OLD | NEW |