| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/android/context_menu_helper.h" | 29 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 30 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" | 30 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" |
| 31 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 31 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
| 32 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 32 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
| 33 #include "chrome/browser/ui/android/window_android_helper.h" | 33 #include "chrome/browser/ui/android/window_android_helper.h" |
| 34 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 34 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 35 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 35 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
| 36 #include "chrome/browser/ui/search/search_tab_helper.h" | 36 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 37 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 37 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 38 #include "chrome/browser/ui/tab_helpers.h" | 38 #include "chrome/browser/ui/tab_helpers.h" |
| 39 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | |
| 40 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
| 41 #include "components/google/core/browser/google_url_tracker.h" | 40 #include "components/google/core/browser/google_url_tracker.h" |
| 42 #include "components/google/core/browser/google_util.h" | 41 #include "components/google/core/browser/google_util.h" |
| 43 #include "components/infobars/core/infobar_container.h" | 42 #include "components/infobars/core/infobar_container.h" |
| 44 #include "components/url_fixer/url_fixer.h" | 43 #include "components/url_fixer/url_fixer.h" |
| 45 #include "content/public/browser/android/content_view_core.h" | 44 #include "content/public/browser/android/content_view_core.h" |
| 46 #include "content/public/browser/navigation_entry.h" | 45 #include "content/public/browser/navigation_entry.h" |
| 47 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/user_metrics.h" | 47 #include "content/public/browser/user_metrics.h" |
| 49 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 search_tab_helper->SupportsInstant()) { | 547 search_tab_helper->SupportsInstant()) { |
| 549 search_tab_helper->Submit(search_terms); | 548 search_tab_helper->Submit(search_terms); |
| 550 return DEFAULT_PAGE_LOAD; | 549 return DEFAULT_PAGE_LOAD; |
| 551 } | 550 } |
| 552 load_params.is_renderer_initiated = is_renderer_initiated; | 551 load_params.is_renderer_initiated = is_renderer_initiated; |
| 553 web_contents()->GetController().LoadURLWithParams(load_params); | 552 web_contents()->GetController().LoadURLWithParams(load_params); |
| 554 } | 553 } |
| 555 return DEFAULT_PAGE_LOAD; | 554 return DEFAULT_PAGE_LOAD; |
| 556 } | 555 } |
| 557 | 556 |
| 558 ToolbarModel::SecurityLevel TabAndroid::GetSecurityLevel(JNIEnv* env, | |
| 559 jobject obj) { | |
| 560 return ToolbarModelImpl::GetSecurityLevelForWebContents(web_contents()); | |
| 561 } | |
| 562 | |
| 563 void TabAndroid::SetActiveNavigationEntryTitleForUrl(JNIEnv* env, | 557 void TabAndroid::SetActiveNavigationEntryTitleForUrl(JNIEnv* env, |
| 564 jobject obj, | 558 jobject obj, |
| 565 jstring jurl, | 559 jstring jurl, |
| 566 jstring jtitle) { | 560 jstring jtitle) { |
| 567 DCHECK(web_contents()); | 561 DCHECK(web_contents()); |
| 568 | 562 |
| 569 base::string16 title; | 563 base::string16 title; |
| 570 if (jtitle) | 564 if (jtitle) |
| 571 title = base::android::ConvertJavaStringToUTF16(env, jtitle); | 565 title = base::android::ConvertJavaStringToUTF16(env, jtitle); |
| 572 | 566 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 641 |
| 648 static void Init(JNIEnv* env, jobject obj) { | 642 static void Init(JNIEnv* env, jobject obj) { |
| 649 TRACE_EVENT0("native", "TabAndroid::Init"); | 643 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 650 // This will automatically bind to the Java object and pass ownership there. | 644 // This will automatically bind to the Java object and pass ownership there. |
| 651 new TabAndroid(env, obj); | 645 new TabAndroid(env, obj); |
| 652 } | 646 } |
| 653 | 647 |
| 654 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 648 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 655 return RegisterNativesImpl(env); | 649 return RegisterNativesImpl(env); |
| 656 } | 650 } |
| OLD | NEW |