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

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

Issue 320253004: Componentize URLFixerUpper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fix Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/DEPS ('k') | chrome/browser/android/url_utilities.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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/ui/android/context_menu_helper.h" 28 #include "chrome/browser/ui/android/context_menu_helper.h"
29 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" 29 #include "chrome/browser/ui/android/infobars/infobar_container_android.h"
30 #include "chrome/browser/ui/android/tab_model/tab_model.h" 30 #include "chrome/browser/ui/android/tab_model/tab_model.h"
31 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 31 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
32 #include "chrome/browser/ui/android/window_android_helper.h" 32 #include "chrome/browser/ui/android/window_android_helper.h"
33 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 33 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
34 #include "chrome/browser/ui/search/search_tab_helper.h" 34 #include "chrome/browser/ui/search/search_tab_helper.h"
35 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 35 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
36 #include "chrome/browser/ui/tab_helpers.h" 36 #include "chrome/browser/ui/tab_helpers.h"
37 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" 37 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
38 #include "chrome/common/net/url_fixer_upper.h"
39 #include "chrome/common/url_constants.h" 38 #include "chrome/common/url_constants.h"
40 #include "components/google/core/browser/google_url_tracker.h" 39 #include "components/google/core/browser/google_url_tracker.h"
41 #include "components/infobars/core/infobar_container.h" 40 #include "components/infobars/core/infobar_container.h"
41 #include "components/url_fixer/url_fixer.h"
42 #include "content/public/browser/android/content_view_core.h" 42 #include "content/public/browser/android/content_view_core.h"
43 #include "content/public/browser/navigation_entry.h" 43 #include "content/public/browser/navigation_entry.h"
44 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
45 #include "content/public/browser/user_metrics.h" 45 #include "content/public/browser/user_metrics.h"
46 #include "content/public/browser/web_contents.h" 46 #include "content/public/browser/web_contents.h"
47 #include "jni/Tab_jni.h" 47 #include "jni/Tab_jni.h"
48 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" 48 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
49 49
50 TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) { 50 TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) {
51 CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(web_contents); 51 CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(web_contents);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (prerender_manager) { 394 if (prerender_manager) {
395 bool prefetched_page_loaded = HasPrerenderedUrl(gurl); 395 bool prefetched_page_loaded = HasPrerenderedUrl(gurl);
396 // Getting the load status before MaybeUsePrerenderedPage() b/c it resets. 396 // Getting the load status before MaybeUsePrerenderedPage() b/c it resets.
397 chrome::NavigateParams params(NULL, web_contents()); 397 chrome::NavigateParams params(NULL, web_contents());
398 if (prerender_manager->MaybeUsePrerenderedPage(gurl, &params)) { 398 if (prerender_manager->MaybeUsePrerenderedPage(gurl, &params)) {
399 return prefetched_page_loaded ? 399 return prefetched_page_loaded ?
400 FULL_PRERENDERED_PAGE_LOAD : PARTIAL_PRERENDERED_PAGE_LOAD; 400 FULL_PRERENDERED_PAGE_LOAD : PARTIAL_PRERENDERED_PAGE_LOAD;
401 } 401 }
402 } 402 }
403 403
404 GURL fixed_url(URLFixerUpper::FixupURL(gurl.possibly_invalid_spec(), 404 GURL fixed_url(
405 std::string())); 405 url_fixer::FixupURL(gurl.possibly_invalid_spec(), std::string()));
406 if (!fixed_url.is_valid()) 406 if (!fixed_url.is_valid())
407 return PAGE_LOAD_FAILED; 407 return PAGE_LOAD_FAILED;
408 408
409 if (!HandleNonNavigationAboutURL(fixed_url)) { 409 if (!HandleNonNavigationAboutURL(fixed_url)) {
410 // Notify the GoogleURLTracker of searches, it might want to change the 410 // Notify the GoogleURLTracker of searches, it might want to change the
411 // actual Google site used (for instance when in the UK, google.co.uk, when 411 // actual Google site used (for instance when in the UK, google.co.uk, when
412 // in the US google.com). 412 // in the US google.com).
413 // Note that this needs to happen before we initiate the navigation as the 413 // Note that this needs to happen before we initiate the navigation as the
414 // GoogleURLTracker uses the navigation pending notification to trigger the 414 // GoogleURLTracker uses the navigation pending notification to trigger the
415 // infobar. 415 // infobar.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 511
512 static void Init(JNIEnv* env, jobject obj) { 512 static void Init(JNIEnv* env, jobject obj) {
513 TRACE_EVENT0("native", "TabAndroid::Init"); 513 TRACE_EVENT0("native", "TabAndroid::Init");
514 // This will automatically bind to the Java object and pass ownership there. 514 // This will automatically bind to the Java object and pass ownership there.
515 new TabAndroid(env, obj); 515 new TabAndroid(env, obj);
516 } 516 }
517 517
518 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 518 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
519 return RegisterNativesImpl(env); 519 return RegisterNativesImpl(env);
520 } 520 }
OLDNEW
« no previous file with comments | « chrome/DEPS ('k') | chrome/browser/android/url_utilities.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698