Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: components/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 13150004: Support color chooser inside extesions, apps, chrome frame, dev tool (Closed) Base URL: http://git.chromium.org/chromium/src.git@ngcolor
Patch Set: Fixed android build Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_string.h" 10 #include "base/android/jni_string.h"
11 #include "components/web_contents_delegate_android/color_chooser_android.h"
11 #include "content/public/browser/android/content_view_core.h" 12 #include "content/public/browser/android/content_view_core.h"
12 #include "content/public/browser/color_chooser.h" 13 #include "content/public/browser/color_chooser.h"
13 #include "content/public/browser/invalidate_type.h" 14 #include "content/public/browser/invalidate_type.h"
14 #include "content/public/browser/native_web_keyboard_event.h" 15 #include "content/public/browser/native_web_keyboard_event.h"
15 #include "content/public/browser/page_navigator.h" 16 #include "content/public/browser/page_navigator.h"
16 #include "content/public/browser/render_widget_host_view.h" 17 #include "content/public/browser/render_widget_host_view.h"
17 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
18 #include "content/public/common/page_transition_types.h" 19 #include "content/public/common/page_transition_types.h"
19 #include "content/public/common/referrer.h" 20 #include "content/public/common/referrer.h"
20 #include "googleurl/src/gurl.h" 21 #include "googleurl/src/gurl.h"
(...skipping 21 matching lines...) Expand all
42 43
43 ScopedJavaLocalRef<jobject> 44 ScopedJavaLocalRef<jobject>
44 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const { 45 WebContentsDelegateAndroid::GetJavaDelegate(JNIEnv* env) const {
45 return weak_java_delegate_.get(env); 46 return weak_java_delegate_.get(env);
46 } 47 }
47 48
48 // ---------------------------------------------------------------------------- 49 // ----------------------------------------------------------------------------
49 // WebContentsDelegate methods 50 // WebContentsDelegate methods
50 // ---------------------------------------------------------------------------- 51 // ----------------------------------------------------------------------------
51 52
52 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser( 53 ColorChooser* WebContentsDelegateAndroid::OpenColorChooser(WebContents* source,
53 WebContents* source, 54 SkColor color) {
54 int color_chooser_id, 55 return new ColorChooserAndroid(source, color);
55 SkColor color) {
56 return ColorChooser::Create(color_chooser_id, source, color);
57 } 56 }
58 57
59 // OpenURLFromTab() will be called when we're performing a browser-intiated 58 // OpenURLFromTab() will be called when we're performing a browser-intiated
60 // navigation. The most common scenario for this is opening new tabs (see 59 // navigation. The most common scenario for this is opening new tabs (see
61 // RenderViewImpl::decidePolicyForNavigation for more details). 60 // RenderViewImpl::decidePolicyForNavigation for more details).
62 WebContents* WebContentsDelegateAndroid::OpenURLFromTab( 61 WebContents* WebContentsDelegateAndroid::OpenURLFromTab(
63 WebContents* source, 62 WebContents* source,
64 const content::OpenURLParams& params) { 63 const content::OpenURLParams& params) {
65 const GURL& url = params.url; 64 const GURL& url = params.url;
66 WindowOpenDisposition disposition = params.disposition; 65 WindowOpenDisposition disposition = params.disposition;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 323
325 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 324 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
326 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { 325 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) {
327 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; 326 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!";
328 return false; 327 return false;
329 } 328 }
330 return RegisterNativesImpl(env); 329 return RegisterNativesImpl(env);
331 } 330 }
332 331
333 } // namespace components 332 } // namespace components
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698