OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 #include "content/public/browser/android/compositor.h" | 74 #include "content/public/browser/android/compositor.h" |
75 #include "content/public/browser/browser_thread.h" | 75 #include "content/public/browser/browser_thread.h" |
76 #include "content/public/browser/interstitial_page.h" | 76 #include "content/public/browser/interstitial_page.h" |
77 #include "content/public/browser/navigation_entry.h" | 77 #include "content/public/browser/navigation_entry.h" |
78 #include "content/public/browser/notification_service.h" | 78 #include "content/public/browser/notification_service.h" |
79 #include "content/public/browser/render_frame_host.h" | 79 #include "content/public/browser/render_frame_host.h" |
80 #include "content/public/browser/render_process_host.h" | 80 #include "content/public/browser/render_process_host.h" |
81 #include "content/public/browser/render_view_host.h" | 81 #include "content/public/browser/render_view_host.h" |
82 #include "content/public/browser/user_metrics.h" | 82 #include "content/public/browser/user_metrics.h" |
83 #include "content/public/browser/web_contents.h" | 83 #include "content/public/browser/web_contents.h" |
| 84 #include "content/public/common/browser_controls_state.h" |
84 #include "content/public/common/resource_request_body.h" | 85 #include "content/public/common/resource_request_body.h" |
85 #include "content/public/common/top_controls_state.h" | |
86 #include "jni/Tab_jni.h" | 86 #include "jni/Tab_jni.h" |
87 #include "net/base/escape.h" | 87 #include "net/base/escape.h" |
88 #include "skia/ext/image_operations.h" | 88 #include "skia/ext/image_operations.h" |
89 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 89 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
90 #include "ui/android/view_android.h" | 90 #include "ui/android/view_android.h" |
91 #include "ui/android/window_android.h" | 91 #include "ui/android/window_android.h" |
92 #include "ui/base/resource/resource_bundle.h" | 92 #include "ui/base/resource/resource_bundle.h" |
93 #include "ui/base/window_open_disposition.h" | 93 #include "ui/base/window_open_disposition.h" |
94 #include "ui/display/display.h" | 94 #include "ui/display/display.h" |
95 #include "ui/display/screen.h" | 95 #include "ui/display/screen.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 // TODO(jcivelli): is the index important? | 739 // TODO(jcivelli): is the index important? |
740 service->CreateHistoricalTab( | 740 service->CreateHistoricalTab( |
741 sessions::ContentLiveTab::GetForWebContents(web_contents), -1); | 741 sessions::ContentLiveTab::GetForWebContents(web_contents), -1); |
742 } | 742 } |
743 | 743 |
744 void TabAndroid::CreateHistoricalTab(JNIEnv* env, | 744 void TabAndroid::CreateHistoricalTab(JNIEnv* env, |
745 const JavaParamRef<jobject>& obj) { | 745 const JavaParamRef<jobject>& obj) { |
746 TabAndroid::CreateHistoricalTabFromContents(web_contents()); | 746 TabAndroid::CreateHistoricalTabFromContents(web_contents()); |
747 } | 747 } |
748 | 748 |
749 void TabAndroid::UpdateTopControlsState(JNIEnv* env, | 749 void TabAndroid::UpdateBrowserControlsState(JNIEnv* env, |
750 const JavaParamRef<jobject>& obj, | 750 const JavaParamRef<jobject>& obj, |
751 jint constraints, | 751 jint constraints, |
752 jint current, | 752 jint current, |
753 jboolean animate) { | 753 jboolean animate) { |
754 content::TopControlsState constraints_state = | 754 content::BrowserControlsState constraints_state = |
755 static_cast<content::TopControlsState>(constraints); | 755 static_cast<content::BrowserControlsState>(constraints); |
756 content::TopControlsState current_state = | 756 content::BrowserControlsState current_state = |
757 static_cast<content::TopControlsState>(current); | 757 static_cast<content::BrowserControlsState>(current); |
758 WebContents* sender = web_contents(); | 758 WebContents* sender = web_contents(); |
759 sender->Send(new ChromeViewMsg_UpdateTopControlsState( | 759 sender->Send(new ChromeViewMsg_UpdateBrowserControlsState( |
760 sender->GetRoutingID(), constraints_state, current_state, animate)); | 760 sender->GetRoutingID(), constraints_state, current_state, animate)); |
761 | 761 |
762 if (sender->ShowingInterstitialPage()) { | 762 if (sender->ShowingInterstitialPage()) { |
763 content::RenderViewHost* interstitial_view_host = | 763 content::RenderViewHost* interstitial_view_host = |
764 sender->GetInterstitialPage()->GetMainFrame()->GetRenderViewHost(); | 764 sender->GetInterstitialPage()->GetMainFrame()->GetRenderViewHost(); |
765 interstitial_view_host->Send(new ChromeViewMsg_UpdateTopControlsState( | 765 interstitial_view_host->Send(new ChromeViewMsg_UpdateBrowserControlsState( |
766 interstitial_view_host->GetRoutingID(), constraints_state, | 766 interstitial_view_host->GetRoutingID(), constraints_state, |
767 current_state, animate)); | 767 current_state, animate)); |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 void TabAndroid::LoadOriginalImage(JNIEnv* env, | 771 void TabAndroid::LoadOriginalImage(JNIEnv* env, |
772 const JavaParamRef<jobject>& obj) { | 772 const JavaParamRef<jobject>& obj) { |
773 content::RenderFrameHost* render_frame_host = | 773 content::RenderFrameHost* render_frame_host = |
774 web_contents()->GetFocusedFrame(); | 774 web_contents()->GetFocusedFrame(); |
775 render_frame_host->Send(new ChromeViewMsg_RequestReloadImageForContextNode( | 775 render_frame_host->Send(new ChromeViewMsg_RequestReloadImageForContextNode( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 882 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
883 TRACE_EVENT0("native", "TabAndroid::Init"); | 883 TRACE_EVENT0("native", "TabAndroid::Init"); |
884 // This will automatically bind to the Java object and pass ownership there. | 884 // This will automatically bind to the Java object and pass ownership there. |
885 new TabAndroid(env, obj); | 885 new TabAndroid(env, obj); |
886 } | 886 } |
887 | 887 |
888 // static | 888 // static |
889 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 889 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
890 return RegisterNativesImpl(env); | 890 return RegisterNativesImpl(env); |
891 } | 891 } |
OLD | NEW |