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

Unified Diff: components/web_contents_delegate_android/color_chooser_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: Removed chrome/browser/ui/color_chooser.cc Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/web_contents_delegate_android/color_chooser_android.cc
diff --git a/components/web_contents_delegate_android/color_chooser_android.cc b/components/web_contents_delegate_android/color_chooser_android.cc
index 56d25cb163eda6207cc41ca7c71bf6ca866d395b..d0d8204c3cd5b01370e30f98841a2ec880eba60d 100644
--- a/components/web_contents_delegate_android/color_chooser_android.cc
+++ b/components/web_contents_delegate_android/color_chooser_android.cc
@@ -10,24 +10,17 @@
#include "jni/ColorChooserAndroid_jni.h"
namespace content {
-
-ColorChooser* ColorChooser::Create(
- int identifier, WebContents* tab, SkColor initial_color) {
- return new components::ColorChooserAndroid(identifier, tab, initial_color);
-}
-
+class WebContents;
} // namespace content
namespace components {
-ColorChooserAndroid::ColorChooserAndroid(int identifier,
- content::WebContents* web_contents,
+ColorChooserAndroid::ColorChooserAndroid(content::WebContents* web_contents,
SkColor initial_color)
- : ColorChooser::ColorChooser(identifier),
- content::WebContentsObserver(web_contents) {
+ : web_contents_(web_contents) {
JNIEnv* env = AttachCurrentThread();
content::ContentViewCore* content_view_core =
- content::ContentViewCore::FromWebContents(web_contents);
+ web_contents_->GetView()->GetContentNativeView();
DCHECK(content_view_core);
j_color_chooser_.Reset(Java_ColorChooserAndroid_createColorChooserAndroid(
@@ -54,8 +47,8 @@ void ColorChooserAndroid::SetSelectedColor(SkColor color) {
}
void ColorChooserAndroid::OnColorChosen(JNIEnv* env, jobject obj, jint color) {
- web_contents()->DidChooseColorInColorChooser(identifier(), color);
- web_contents()->DidEndColorChooser(identifier());
+ web_contents_->DidChooseColorInColorChooser(color);
+ web_contents_->DidEndColorChooser();
}
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698