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

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

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 3 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 | « no previous file | chrome/browser/extensions/api/sessions/sessions_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "components/bookmarks/managed/managed_bookmark_service.h" 56 #include "components/bookmarks/managed/managed_bookmark_service.h"
57 #include "components/dom_distiller/core/url_utils.h" 57 #include "components/dom_distiller/core/url_utils.h"
58 #include "components/favicon/content/content_favicon_driver.h" 58 #include "components/favicon/content/content_favicon_driver.h"
59 #include "components/infobars/core/infobar.h" 59 #include "components/infobars/core/infobar.h"
60 #include "components/infobars/core/infobar_container.h" 60 #include "components/infobars/core/infobar_container.h"
61 #include "components/navigation_interception/intercept_navigation_delegate.h" 61 #include "components/navigation_interception/intercept_navigation_delegate.h"
62 #include "components/navigation_interception/navigation_params.h" 62 #include "components/navigation_interception/navigation_params.h"
63 #include "components/offline_pages/offline_page_feature.h" 63 #include "components/offline_pages/offline_page_feature.h"
64 #include "components/offline_pages/offline_page_item.h" 64 #include "components/offline_pages/offline_page_item.h"
65 #include "components/offline_pages/offline_page_model.h" 65 #include "components/offline_pages/offline_page_model.h"
66 #include "components/sessions/content/content_live_tab.h"
66 #include "components/url_formatter/url_fixer.h" 67 #include "components/url_formatter/url_fixer.h"
67 #include "content/public/browser/android/compositor.h" 68 #include "content/public/browser/android/compositor.h"
68 #include "content/public/browser/android/content_view_core.h" 69 #include "content/public/browser/android/content_view_core.h"
69 #include "content/public/browser/browser_thread.h" 70 #include "content/public/browser/browser_thread.h"
70 #include "content/public/browser/interstitial_page.h" 71 #include "content/public/browser/interstitial_page.h"
71 #include "content/public/browser/navigation_entry.h" 72 #include "content/public/browser/navigation_entry.h"
72 #include "content/public/browser/notification_service.h" 73 #include "content/public/browser/notification_service.h"
73 #include "content/public/browser/render_frame_host.h" 74 #include "content/public/browser/render_frame_host.h"
74 #include "content/public/browser/render_process_host.h" 75 #include "content/public/browser/render_process_host.h"
75 #include "content/public/browser/render_view_host.h" 76 #include "content/public/browser/render_view_host.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 730
730 // Exclude internal pages from being marked as recent when they are closed. 731 // Exclude internal pages from being marked as recent when they are closed.
731 const GURL& tab_url = web_contents->GetURL(); 732 const GURL& tab_url = web_contents->GetURL();
732 if (tab_url.SchemeIs(content::kChromeUIScheme) || 733 if (tab_url.SchemeIs(content::kChromeUIScheme) ||
733 tab_url.SchemeIs(chrome::kChromeNativeScheme) || 734 tab_url.SchemeIs(chrome::kChromeNativeScheme) ||
734 tab_url.SchemeIs(url::kAboutScheme)) { 735 tab_url.SchemeIs(url::kAboutScheme)) {
735 return; 736 return;
736 } 737 }
737 738
738 // TODO(jcivelli): is the index important? 739 // TODO(jcivelli): is the index important?
739 service->CreateHistoricalTab(web_contents, -1); 740 service->CreateHistoricalTab(
741 sessions::ContentLiveTab::FromWebContents(web_contents), -1);
740 } 742 }
741 743
742 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) { 744 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) {
743 TabAndroid::CreateHistoricalTabFromContents(web_contents()); 745 TabAndroid::CreateHistoricalTabFromContents(web_contents());
744 } 746 }
745 747
746 void TabAndroid::UpdateTopControlsState(JNIEnv* env, 748 void TabAndroid::UpdateTopControlsState(JNIEnv* env,
747 jobject obj, 749 jobject obj,
748 jint constraints, 750 jint constraints,
749 jint current, 751 jint current,
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 // s^{n+1} / s^{n} = 2100 / 2000 979 // s^{n+1} / s^{n} = 2100 / 2000
978 // s = 1.05 980 // s = 1.05
979 // s^b = 60000 981 // s^b = 60000
980 // b = ln(60000) / ln(1.05) ~= 225 982 // b = ln(60000) / ln(1.05) ~= 225
981 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 983 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
982 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 984 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
983 base::TimeDelta::FromMilliseconds(1), 985 base::TimeDelta::FromMilliseconds(1),
984 base::TimeDelta::FromMinutes(1), 986 base::TimeDelta::FromMinutes(1),
985 225); 987 225);
986 } 988 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/sessions/sessions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698