| 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" | 34 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" |
| 35 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 35 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
| 36 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 36 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
| 37 #include "chrome/browser/ui/android/window_android_helper.h" | 37 #include "chrome/browser/ui/android/window_android_helper.h" |
| 38 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 38 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 39 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 39 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
| 40 #include "chrome/browser/ui/search/search_tab_helper.h" | 40 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 41 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 41 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 42 #include "chrome/browser/ui/tab_helpers.h" | 42 #include "chrome/browser/ui/tab_helpers.h" |
| 43 #include "chrome/common/instant_types.h" | 43 #include "chrome/common/instant_types.h" |
| 44 #include "chrome/common/render_messages.h" |
| 44 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 45 #include "components/google/core/browser/google_url_tracker.h" | 46 #include "components/google/core/browser/google_url_tracker.h" |
| 46 #include "components/google/core/browser/google_util.h" | 47 #include "components/google/core/browser/google_util.h" |
| 47 #include "components/infobars/core/infobar_container.h" | 48 #include "components/infobars/core/infobar_container.h" |
| 48 #include "components/url_fixer/url_fixer.h" | 49 #include "components/url_fixer/url_fixer.h" |
| 49 #include "content/public/browser/android/content_view_core.h" | 50 #include "content/public/browser/android/content_view_core.h" |
| 50 #include "content/public/browser/navigation_entry.h" | 51 #include "content/public/browser/navigation_entry.h" |
| 51 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 52 #include "content/public/browser/render_process_host.h" | 53 #include "content/public/browser/render_process_host.h" |
| 53 #include "content/public/browser/user_metrics.h" | 54 #include "content/public/browser/user_metrics.h" |
| 54 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 56 #include "content/public/common/top_controls_state.h" |
| 55 #include "jni/Tab_jni.h" | 57 #include "jni/Tab_jni.h" |
| 56 #include "skia/ext/image_operations.h" | 58 #include "skia/ext/image_operations.h" |
| 57 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 59 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
| 58 #include "ui/base/resource/resource_bundle.h" | 60 #include "ui/base/resource/resource_bundle.h" |
| 59 #include "ui/base/window_open_disposition.h" | 61 #include "ui/base/window_open_disposition.h" |
| 60 #include "ui/gfx/android/device_display_info.h" | 62 #include "ui/gfx/android/device_display_info.h" |
| 61 #include "ui/gfx/android/java_bitmap.h" | 63 #include "ui/gfx/android/java_bitmap.h" |
| 62 #include "ui/gfx/favicon_size.h" | 64 #include "ui/gfx/favicon_size.h" |
| 63 #include "ui/gfx/image/image_skia.h" | 65 #include "ui/gfx/image/image_skia.h" |
| 64 | 66 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 707 } |
| 706 | 708 |
| 707 // TODO(jcivelli): is the index important? | 709 // TODO(jcivelli): is the index important? |
| 708 service->CreateHistoricalTab(web_contents, -1); | 710 service->CreateHistoricalTab(web_contents, -1); |
| 709 } | 711 } |
| 710 | 712 |
| 711 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) { | 713 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) { |
| 712 TabAndroid::CreateHistoricalTabFromContents(web_contents()); | 714 TabAndroid::CreateHistoricalTabFromContents(web_contents()); |
| 713 } | 715 } |
| 714 | 716 |
| 717 void TabAndroid::UpdateTopControlsState(JNIEnv* env, |
| 718 jobject obj, |
| 719 jint constraints, |
| 720 jint current, |
| 721 jboolean animate) { |
| 722 content::TopControlsState constraints_state = |
| 723 static_cast<content::TopControlsState>(constraints); |
| 724 content::TopControlsState current_state = |
| 725 static_cast<content::TopControlsState>(current); |
| 726 WebContents* sender = web_contents(); |
| 727 sender->Send(new ChromeViewMsg_UpdateTopControlsState( |
| 728 sender->GetRoutingID(), constraints_state, current_state, animate)); |
| 729 } |
| 730 |
| 715 static void Init(JNIEnv* env, jobject obj) { | 731 static void Init(JNIEnv* env, jobject obj) { |
| 716 TRACE_EVENT0("native", "TabAndroid::Init"); | 732 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 717 // This will automatically bind to the Java object and pass ownership there. | 733 // This will automatically bind to the Java object and pass ownership there. |
| 718 new TabAndroid(env, obj); | 734 new TabAndroid(env, obj); |
| 719 } | 735 } |
| 720 | 736 |
| 721 // static | 737 // static |
| 722 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 738 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 723 return RegisterNativesImpl(env); | 739 return RegisterNativesImpl(env); |
| 724 } | 740 } |
| OLD | NEW |