Index: android_webview/browser/aw_web_contents_view_delegate.cc |
diff --git a/android_webview/browser/aw_web_contents_view_delegate.cc b/android_webview/browser/aw_web_contents_view_delegate.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b8d2ee99bbe19b758b00989c987414406abd22fc |
--- /dev/null |
+++ b/android_webview/browser/aw_web_contents_view_delegate.cc |
@@ -0,0 +1,41 @@ |
+// 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 "android_webview/browser/aw_web_contents_view_delegate.h" |
+ |
+#include "android_webview/native/aw_contents.h" |
+#include "content/public/browser/web_contents.h" |
+ |
+namespace android_webview { |
+ |
+AwWebContentsViewDelegate::AwWebContentsViewDelegate( |
+ content::WebContents* web_contents) |
+ : web_contents_(web_contents) { |
+} |
+ |
+AwWebContentsViewDelegate::~AwWebContentsViewDelegate() {} |
+ |
+content::WebDragDestDelegate* AwWebContentsViewDelegate::GetDragDestDelegate() { |
+ // GetDragDestDelegate is a pure virtual method from WebContentsViewDelegate |
+ // and must have an implementation although android doesn't use it. |
+ NOTREACHED(); |
+ return NULL; |
+} |
+ |
+void AwWebContentsViewDelegate::ShowContextMenu( |
+ const content::ContextMenuParams& params, |
+ content::ContextMenuSourceType type) { |
+ // TODO(boliu): Maybe we don't want to convert all context menu events to long |
+ // press. |
joth
2012/12/08 01:29:12
also may want to do the same content_view_core->Sh
boliu
2012/12/10 20:19:28
Done.
|
+ |
+ AwContents* aw_contents = AwContents::FromWebContents(web_contents_); |
+ if (!aw_contents) |
+ return; |
joth
2012/12/08 01:29:12
it feels like this class could be implemented in t
boliu
2012/12/10 20:19:28
Done.
|
+ |
+ // More hackery can be done to combine |params| with the rest of the |
+ // hit test methods if context menus are not working. |
+ aw_contents->ConvertContextMenuCallbackToLongPress(); |
+} |
+ |
+} // namespace android_webview |