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

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: 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 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..23285710865b9022baedad2afd07283fa0d09bcf 100644
--- a/components/web_contents_delegate_android/color_chooser_android.cc
+++ b/components/web_contents_delegate_android/color_chooser_android.cc
@@ -9,22 +9,11 @@
#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* 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);
@@ -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