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

Unified Diff: android_webview/native/aw_web_contents_view_delegate.h

Issue 11471040: [Android WebView] Convert context menu callback to long press (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments. Ready for review/submit. Created 8 years 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: android_webview/native/aw_web_contents_view_delegate.h
diff --git a/android_webview/native/aw_web_contents_view_delegate.h b/android_webview/native/aw_web_contents_view_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..6eb7da4b509d81d084c709edb4ea1606f321ca4d
--- /dev/null
+++ b/android_webview/native/aw_web_contents_view_delegate.h
@@ -0,0 +1,48 @@
+// 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.
+
+#ifndef ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_
+#define ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_
+
+#include "content/public/browser/web_contents_view_delegate.h"
+
+#include "base/android/scoped_java_ref.h"
+#include "base/compiler_specific.h"
+
+namespace content {
+class WebContents;
+} // namespace content
+
+namespace android_webview {
+
+class AwContents;
+
+// This class is only used to create context menus on Android.
+class AwWebContentsViewDelegate : public content::WebContentsViewDelegate {
+ public:
+ AwWebContentsViewDelegate(content::WebContents* web_contents);
+ virtual ~AwWebContentsViewDelegate();
+
+ // content::WebContentsViewDelegate implementation.
+ virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE;
+ virtual void ShowContextMenu(
+ const content::ContextMenuParams& params,
+ content::ContextMenuSourceType type) OVERRIDE;
+
+ private:
+ // Weak pointer due to ownership graph:
+ // WebContents->WebContentsView->this.
+ content::WebContents* web_contents_;
+
+ base::android::ScopedJavaGlobalRef<jobject> web_contents_view_delegate_;
joth 2012/12/11 01:22:11 ah. hmm. this maybe a problem: this will stop the
boliu 2012/12/11 02:25:33 That dependency graph feels weird...does this work
joth 2012/12/11 02:37:39 yeah, it feels weird -- par for the course in mixi
+
+ DISALLOW_COPY_AND_ASSIGN(AwWebContentsViewDelegate);
+};
+
+bool RegisterAwWebContentsViewDelegate(JNIEnv* env);
+
+} // namespace android_webview
+
+
+#endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698