Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_ | |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_ | |
| 7 | |
| 8 #include "content/public/browser/web_contents_view_delegate.h" | |
| 9 | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 #include "base/compiler_specific.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class WebContents; | |
| 15 } // namespace content | |
| 16 | |
| 17 namespace android_webview { | |
| 18 | |
| 19 class AwContents; | |
| 20 | |
| 21 // This class is only used to create context menus on Android. | |
| 22 class AwWebContentsViewDelegate : public content::WebContentsViewDelegate { | |
| 23 public: | |
| 24 AwWebContentsViewDelegate(content::WebContents* web_contents); | |
| 25 virtual ~AwWebContentsViewDelegate(); | |
| 26 | |
| 27 // content::WebContentsViewDelegate implementation. | |
| 28 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; | |
| 29 virtual void ShowContextMenu( | |
| 30 const content::ContextMenuParams& params, | |
| 31 content::ContextMenuSourceType type) OVERRIDE; | |
| 32 | |
| 33 private: | |
| 34 // Weak pointer due to ownership graph: | |
| 35 // WebContents->WebContentsView->this. | |
| 36 content::WebContents* web_contents_; | |
| 37 | |
| 38 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
| |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(AwWebContentsViewDelegate); | |
| 41 }; | |
| 42 | |
| 43 bool RegisterAwWebContentsViewDelegate(JNIEnv* env); | |
| 44 | |
| 45 } // namespace android_webview | |
| 46 | |
| 47 | |
| 48 #endif // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_ | |
| OLD | NEW |