| 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 "components/web_contents_delegate_android/web_contents_delegate_android
.h" | 5 #include "components/web_contents_delegate_android/web_contents_delegate_android
.h" |
| 6 | 6 |
| 7 #include <android/keycodes.h> | 7 #include <android/keycodes.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 ScopedJavaLocalRef<jobject> | 44 ScopedJavaLocalRef<jobject> |
| 45 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const { | 45 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const { |
| 46 return weak_java_delegate_.get(env); | 46 return weak_java_delegate_.get(env); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // ---------------------------------------------------------------------------- | 49 // ---------------------------------------------------------------------------- |
| 50 // WebContentsDelegate methods | 50 // WebContentsDelegate methods |
| 51 // ---------------------------------------------------------------------------- | 51 // ---------------------------------------------------------------------------- |
| 52 | 52 |
| 53 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser(WebContents* source, | 53 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser( |
| 54 SkColor color) { | 54 WebContents* source, |
| 55 return new ColorChooserAndroid(source, color); | 55 SkColor color, |
| 56 const std::vector<content::ColorSuggestion>& suggestions) { |
| 57 return new ColorChooserAndroid(source, color, suggestions); |
| 56 } | 58 } |
| 57 | 59 |
| 58 // OpenURLFromTab() will be called when we're performing a browser-intiated | 60 // OpenURLFromTab() will be called when we're performing a browser-intiated |
| 59 // navigation. The most common scenario for this is opening new tabs (see | 61 // navigation. The most common scenario for this is opening new tabs (see |
| 60 // RenderViewImpl::decidePolicyForNavigation for more details). | 62 // RenderViewImpl::decidePolicyForNavigation for more details). |
| 61 WebContents* WebContentsDelegateAndroid::OpenURLFromTab( | 63 WebContents* WebContentsDelegateAndroid::OpenURLFromTab( |
| 62 WebContents* source, | 64 WebContents* source, |
| 63 const content::OpenURLParams& params) { | 65 const content::OpenURLParams& params) { |
| 64 const GURL& url = params.url; | 66 const GURL& url = params.url; |
| 65 WindowOpenDisposition disposition = params.disposition; | 67 WindowOpenDisposition disposition = params.disposition; |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // Native JNI methods | 325 // Native JNI methods |
| 324 // ---------------------------------------------------------------------------- | 326 // ---------------------------------------------------------------------------- |
| 325 | 327 |
| 326 // Register native methods | 328 // Register native methods |
| 327 | 329 |
| 328 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 330 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
| 329 return RegisterNativesImpl(env); | 331 return RegisterNativesImpl(env); |
| 330 } | 332 } |
| 331 | 333 |
| 332 } // namespace web_contents_delegate_android | 334 } // namespace web_contents_delegate_android |
| OLD | NEW |