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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.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/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
39 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
40 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
41 #include "content/public/common/content_client.h" | 41 #include "content/public/common/content_client.h" |
42 #include "content/public/common/content_switches.h" | 42 #include "content/public/common/content_switches.h" |
43 #include "content/public/common/page_transition_types.h" | 43 #include "content/public/common/page_transition_types.h" |
44 #include "jni/ContentViewCore_jni.h" | 44 #include "jni/ContentViewCore_jni.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/android/WebInputEvent
Factory.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/android/WebInputEvent
Factory.h" |
| 48 #include "ui/android/window_android.h" |
48 #include "ui/gfx/android/java_bitmap.h" | 49 #include "ui/gfx/android/java_bitmap.h" |
49 #include "ui/gfx/android/window_android.h" | |
50 #include "ui/gfx/screen.h" | 50 #include "ui/gfx/screen.h" |
51 #include "ui/gfx/size_conversions.h" | 51 #include "ui/gfx/size_conversions.h" |
52 #include "ui/gfx/size_f.h" | 52 #include "ui/gfx/size_f.h" |
53 #include "webkit/glue/webmenuitem.h" | 53 #include "webkit/glue/webmenuitem.h" |
54 #include "webkit/user_agent/user_agent_util.h" | 54 #include "webkit/user_agent/user_agent_util.h" |
55 | 55 |
56 using base::android::AttachCurrentThread; | 56 using base::android::AttachCurrentThread; |
57 using base::android::ConvertJavaStringToUTF16; | 57 using base::android::ConvertJavaStringToUTF16; |
58 using base::android::ConvertJavaStringToUTF8; | 58 using base::android::ConvertJavaStringToUTF8; |
59 using base::android::ConvertUTF16ToJavaString; | 59 using base::android::ConvertUTF16ToJavaString; |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 layer->RemoveFromParent(); | 676 layer->RemoveFromParent(); |
677 } | 677 } |
678 | 678 |
679 void ContentViewCoreImpl::LoadUrl( | 679 void ContentViewCoreImpl::LoadUrl( |
680 NavigationController::LoadURLParams& params) { | 680 NavigationController::LoadURLParams& params) { |
681 GetWebContents()->GetController().LoadURLWithParams(params); | 681 GetWebContents()->GetController().LoadURLWithParams(params); |
682 tab_crashed_ = false; | 682 tab_crashed_ = false; |
683 } | 683 } |
684 | 684 |
685 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { | 685 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { |
| 686 // This should never be NULL for Chrome, but will be NULL for WebView. |
| 687 DCHECK(window_android_); |
686 return window_android_; | 688 return window_android_; |
687 } | 689 } |
688 | 690 |
689 scoped_refptr<cc::Layer> ContentViewCoreImpl::GetLayer() const { | 691 scoped_refptr<cc::Layer> ContentViewCoreImpl::GetLayer() const { |
690 return root_layer_.get(); | 692 return root_layer_.get(); |
691 } | 693 } |
692 | 694 |
693 // ---------------------------------------------------------------------------- | 695 // ---------------------------------------------------------------------------- |
694 // Methods called from Java via JNI | 696 // Methods called from Java via JNI |
695 // ---------------------------------------------------------------------------- | 697 // ---------------------------------------------------------------------------- |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 reinterpret_cast<WebContents*>(native_web_contents), | 1479 reinterpret_cast<WebContents*>(native_web_contents), |
1478 reinterpret_cast<ui::WindowAndroid*>(native_window)); | 1480 reinterpret_cast<ui::WindowAndroid*>(native_window)); |
1479 return reinterpret_cast<jint>(view); | 1481 return reinterpret_cast<jint>(view); |
1480 } | 1482 } |
1481 | 1483 |
1482 bool RegisterContentViewCore(JNIEnv* env) { | 1484 bool RegisterContentViewCore(JNIEnv* env) { |
1483 return RegisterNativesImpl(env); | 1485 return RegisterNativesImpl(env); |
1484 } | 1486 } |
1485 | 1487 |
1486 } // namespace content | 1488 } // namespace content |
OLD | NEW |