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

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: Used static class member 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 b0f53d5d8510604e4b9d76bc989d2940269a15e0..670e464d4334b2ccd6a86c8f937c5d4f67d2585a 100644
--- a/components/web_contents_delegate_android/color_chooser_android.cc
+++ b/components/web_contents_delegate_android/color_chooser_android.cc
@@ -9,25 +9,14 @@
#include "content/public/browser/web_contents_view.h"
#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);
-}
-
-} // namespace content
-
namespace components {
-ColorChooserAndroid::ColorChooserAndroid(int identifier,
- content::WebContents* tab,
+ColorChooserAndroid::ColorChooserAndroid(content::WebContents* web_contents,
SkColor initial_color)
- : ColorChooser::ColorChooser(identifier),
- content::WebContentsObserver(tab) {
+ : content::WebContentsObserver(web_contents) {
JNIEnv* env = AttachCurrentThread();
content::ContentViewCore* content_view_core =
- tab->GetView()->GetContentNativeView();
+ web_contents->GetView()->GetContentNativeView();
DCHECK(content_view_core);
j_color_chooser_.Reset(Java_ColorChooserAndroid_createColorChooserAndroid(
@@ -54,8 +43,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