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

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

Issue 1049383008: Properly attach InfoBarContainer when it is swapped to a new WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 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
OLDNEW
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
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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 // s^{n+1} / s^{n} = 2100 / 2000 870 // s^{n+1} / s^{n} = 2100 / 2000
882 // s = 1.05 871 // s = 1.05
883 // s^b = 60000 872 // s^b = 60000
884 // b = ln(60000) / ln(1.05) ~= 225 873 // b = ln(60000) / ln(1.05) ~= 225
885 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 874 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
886 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 875 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
887 base::TimeDelta::FromMilliseconds(1), 876 base::TimeDelta::FromMilliseconds(1),
888 base::TimeDelta::FromMinutes(1), 877 base::TimeDelta::FromMinutes(1),
889 225); 878 225);
890 } 879 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698