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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } | 708 } |
707 | 709 |
708 // TODO(jcivelli): is the index important? | 710 // TODO(jcivelli): is the index important? |
709 service->CreateHistoricalTab(web_contents, -1); | 711 service->CreateHistoricalTab(web_contents, -1); |
710 } | 712 } |
711 | 713 |
712 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) { | 714 void TabAndroid::CreateHistoricalTab(JNIEnv* env, jobject obj) { |
713 TabAndroid::CreateHistoricalTabFromContents(web_contents()); | 715 TabAndroid::CreateHistoricalTabFromContents(web_contents()); |
714 } | 716 } |
715 | 717 |
| 718 void TabAndroid::UpdateTopControlsState(JNIEnv* env, |
| 719 jobject obj, |
| 720 jint constraints, |
| 721 jint current, |
| 722 jboolean animate) { |
| 723 content::TopControlsState constraints_state = |
| 724 static_cast<content::TopControlsState>(constraints); |
| 725 content::TopControlsState current_state = |
| 726 static_cast<content::TopControlsState>(current); |
| 727 WebContents* sender = web_contents(); |
| 728 sender->Send(new ChromeViewMsg_UpdateTopControlsState( |
| 729 sender->GetRoutingID(), constraints_state, current_state, animate)); |
| 730 } |
| 731 |
716 static void Init(JNIEnv* env, jobject obj) { | 732 static void Init(JNIEnv* env, jobject obj) { |
717 TRACE_EVENT0("native", "TabAndroid::Init"); | 733 TRACE_EVENT0("native", "TabAndroid::Init"); |
718 // This will automatically bind to the Java object and pass ownership there. | 734 // This will automatically bind to the Java object and pass ownership there. |
719 new TabAndroid(env, obj); | 735 new TabAndroid(env, obj); |
720 } | 736 } |
721 | 737 |
722 // static | 738 // static |
723 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 739 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
724 return RegisterNativesImpl(env); | 740 return RegisterNativesImpl(env); |
725 } | 741 } |
OLD | NEW |