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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 ScopedJavaLocalRef<jobject> | 45 ScopedJavaLocalRef<jobject> |
46 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const { | 46 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const { |
47 return weak_java_delegate_.get(env); | 47 return weak_java_delegate_.get(env); |
48 } | 48 } |
49 | 49 |
50 // ---------------------------------------------------------------------------- | 50 // ---------------------------------------------------------------------------- |
51 // WebContentsDelegate methods | 51 // WebContentsDelegate methods |
52 // ---------------------------------------------------------------------------- | 52 // ---------------------------------------------------------------------------- |
53 | 53 |
54 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser(WebContents* source, | 54 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser( |
55 SkColor color) { | 55 WebContents* source, |
56 return new ColorChooserAndroid(source, color); | 56 SkColor color, |
| 57 const std::vector<SkColor>& suggestions, |
| 58 const std::vector<string16>& suggestion_labels) { |
| 59 return new ColorChooserAndroid(source, color, suggestions, suggestion_labels); |
57 } | 60 } |
58 | 61 |
59 // OpenURLFromTab() will be called when we're performing a browser-intiated | 62 // OpenURLFromTab() will be called when we're performing a browser-intiated |
60 // navigation. The most common scenario for this is opening new tabs (see | 63 // navigation. The most common scenario for this is opening new tabs (see |
61 // RenderViewImpl::decidePolicyForNavigation for more details). | 64 // RenderViewImpl::decidePolicyForNavigation for more details). |
62 WebContents* WebContentsDelegateAndroid::OpenURLFromTab( | 65 WebContents* WebContentsDelegateAndroid::OpenURLFromTab( |
63 WebContents* source, | 66 WebContents* source, |
64 const content::OpenURLParams& params) { | 67 const content::OpenURLParams& params) { |
65 const GURL& url = params.url; | 68 const GURL& url = params.url; |
66 WindowOpenDisposition disposition = params.disposition; | 69 WindowOpenDisposition disposition = params.disposition; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 355 |
353 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 356 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
354 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { | 357 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { |
355 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; | 358 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; |
356 return false; | 359 return false; |
357 } | 360 } |
358 return RegisterNativesImpl(env); | 361 return RegisterNativesImpl(env); |
359 } | 362 } |
360 | 363 |
361 } // namespace web_contents_delegate_android | 364 } // namespace web_contents_delegate_android |
OLD | NEW |