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

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

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS Created 5 years, 4 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 prerender::PrerenderManager* prerender_manager = 545 prerender::PrerenderManager* prerender_manager =
546 prerender::PrerenderManagerFactory::GetForProfile(GetProfile()); 546 prerender::PrerenderManagerFactory::GetForProfile(GetProfile());
547 if (prerender_manager) { 547 if (prerender_manager) {
548 bool prefetched_page_loaded = HasPrerenderedUrl(gurl); 548 bool prefetched_page_loaded = HasPrerenderedUrl(gurl);
549 // Getting the load status before MaybeUsePrerenderedPage() b/c it resets. 549 // Getting the load status before MaybeUsePrerenderedPage() b/c it resets.
550 chrome::NavigateParams params(NULL, web_contents()); 550 chrome::NavigateParams params(NULL, web_contents());
551 InstantSearchPrerenderer* prerenderer = 551 InstantSearchPrerenderer* prerenderer =
552 InstantSearchPrerenderer::GetForProfile(GetProfile()); 552 InstantSearchPrerenderer::GetForProfile(GetProfile());
553 if (prerenderer) { 553 if (prerenderer) {
554 const base::string16& search_terms = 554 const base::string16& search_terms =
555 chrome::ExtractSearchTermsFromURL(GetProfile(), gurl); 555 search::ExtractSearchTermsFromURL(GetProfile(), gurl);
556 if (!search_terms.empty() && 556 if (!search_terms.empty() &&
557 prerenderer->CanCommitQuery(web_contents_.get(), search_terms)) { 557 prerenderer->CanCommitQuery(web_contents_.get(), search_terms)) {
558 EmbeddedSearchRequestParams request_params(gurl); 558 EmbeddedSearchRequestParams request_params(gurl);
559 prerenderer->Commit(search_terms, request_params); 559 prerenderer->Commit(search_terms, request_params);
560 560
561 if (prerenderer->UsePrerenderedPage(gurl, &params)) 561 if (prerenderer->UsePrerenderedPage(gurl, &params))
562 return FULL_PRERENDERED_PAGE_LOAD; 562 return FULL_PRERENDERED_PAGE_LOAD;
563 } 563 }
564 prerenderer->Cancel(); 564 prerenderer->Cancel();
565 } 565 }
(...skipping 30 matching lines...) Expand all
596 base::RefCountedBytes::TakeVector(&post_data); 596 base::RefCountedBytes::TakeVector(&post_data);
597 } 597 }
598 load_params.transition_type = 598 load_params.transition_type =
599 ui::PageTransitionFromInt(page_transition); 599 ui::PageTransitionFromInt(page_transition);
600 if (j_referrer_url) { 600 if (j_referrer_url) {
601 load_params.referrer = content::Referrer( 601 load_params.referrer = content::Referrer(
602 GURL(base::android::ConvertJavaStringToUTF8(env, j_referrer_url)), 602 GURL(base::android::ConvertJavaStringToUTF8(env, j_referrer_url)),
603 static_cast<blink::WebReferrerPolicy>(referrer_policy)); 603 static_cast<blink::WebReferrerPolicy>(referrer_policy));
604 } 604 }
605 const base::string16 search_terms = 605 const base::string16 search_terms =
606 chrome::ExtractSearchTermsFromURL(GetProfile(), gurl); 606 search::ExtractSearchTermsFromURL(GetProfile(), gurl);
607 SearchTabHelper* search_tab_helper = 607 SearchTabHelper* search_tab_helper =
608 SearchTabHelper::FromWebContents(web_contents_.get()); 608 SearchTabHelper::FromWebContents(web_contents_.get());
609 if (!search_terms.empty() && search_tab_helper && 609 if (!search_terms.empty() && search_tab_helper &&
610 search_tab_helper->SupportsInstant()) { 610 search_tab_helper->SupportsInstant()) {
611 EmbeddedSearchRequestParams request_params(gurl); 611 EmbeddedSearchRequestParams request_params(gurl);
612 search_tab_helper->Submit(search_terms, request_params); 612 search_tab_helper->Submit(search_terms, request_params);
613 return DEFAULT_PAGE_LOAD; 613 return DEFAULT_PAGE_LOAD;
614 } 614 }
615 load_params.is_renderer_initiated = is_renderer_initiated; 615 load_params.is_renderer_initiated = is_renderer_initiated;
616 load_params.intent_received_timestamp = intent_received_timestamp; 616 load_params.intent_received_timestamp = intent_received_timestamp;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 // s^{n+1} / s^{n} = 2100 / 2000 878 // s^{n+1} / s^{n} = 2100 / 2000
879 // s = 1.05 879 // s = 1.05
880 // s^b = 60000 880 // s^b = 60000
881 // b = ln(60000) / ln(1.05) ~= 225 881 // b = ln(60000) / ln(1.05) ~= 225
882 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime", 882 UMA_HISTOGRAM_CUSTOM_TIMES("Startup.FirstCommitNavigationTime",
883 base::Time::Now() - chrome::android::GetMainEntryPointTime(), 883 base::Time::Now() - chrome::android::GetMainEntryPointTime(),
884 base::TimeDelta::FromMilliseconds(1), 884 base::TimeDelta::FromMilliseconds(1),
885 base::TimeDelta::FromMinutes(1), 885 base::TimeDelta::FromMinutes(1),
886 225); 886 225);
887 } 887 }
OLDNEW
« no previous file with comments | « chrome/browser/android/omnibox/autocomplete_controller_android.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698