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

Unified Diff: content/components/web_contents_delegate_android/color_chooser_android.cc

Issue 11823046: Move content/components/web_contents_delegate_android to components/web_contents_delegate_android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (win7_aura so slow!!) Created 7 years, 11 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: content/components/web_contents_delegate_android/color_chooser_android.cc
diff --git a/content/components/web_contents_delegate_android/color_chooser_android.cc b/content/components/web_contents_delegate_android/color_chooser_android.cc
deleted file mode 100644
index 34ab4f00e80c2d8c9dd2c8ad1602640050d33904..0000000000000000000000000000000000000000
--- a/content/components/web_contents_delegate_android/color_chooser_android.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/components/web_contents_delegate_android/color_chooser_android.h"
-
-#include "content/public/browser/android/content_view_core.h"
-#include "content/public/browser/web_contents.h"
-#include "jni/ColorChooserAndroid_jni.h"
-
-namespace content {
-
-ColorChooserAndroid::ColorChooserAndroid(int identifier,
- content::WebContents* tab,
- SkColor initial_color)
- : ColorChooser::ColorChooser(identifier),
- content::WebContentsObserver(tab) {
- JNIEnv* env = AttachCurrentThread();
- ContentViewCore* content_view_core = tab->GetContentNativeView();
- DCHECK(content_view_core);
-
- j_color_chooser_.Reset(Java_ColorChooserAndroid_createColorChooserAndroid(
- env,
- reinterpret_cast<intptr_t>(this),
- content_view_core->GetJavaObject().obj(),
- initial_color));
-}
-
-ColorChooserAndroid::~ColorChooserAndroid() {
-}
-
-void ColorChooserAndroid::End() {
- if (!j_color_chooser_.is_null()) {
- JNIEnv* env = AttachCurrentThread();
- Java_ColorChooserAndroid_closeColorChooser(env, j_color_chooser_.obj());
- }
-}
-
-void ColorChooserAndroid::SetSelectedColor(SkColor color) {
- // Not implemented since the color is set on the java side only, in theory
- // it can be set from JS which would override the user selection but
- // we don't support that for now.
-}
-
-void ColorChooserAndroid::OnColorChosen(JNIEnv* env, jobject obj, jint color) {
- web_contents()->DidChooseColorInColorChooser(identifier(), color);
- web_contents()->DidEndColorChooser(identifier());
-}
-
-content::ColorChooser* content::ColorChooser::Create(
- int identifier, content::WebContents* tab, SkColor initial_color) {
- return new ColorChooserAndroid(identifier, tab, initial_color);
-}
-
-// ----------------------------------------------------------------------------
-// Native JNI methods
-// ----------------------------------------------------------------------------
-bool RegisterColorChooserAndroid(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698