summaryrefslogtreecommitdiff
path: root/android_webview/native/aw_web_contents_view_delegate.h
blob: f2b4f8e80d5b5004d441b6bd0e60b8491d9a9980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// 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/compiler_specific.h"

namespace content {
class WebContents;
}  // namespace content

namespace android_webview {

class AwContents;

class AwWebContentsViewDelegate : public content::WebContentsViewDelegate {
 public:
  static content::WebContentsViewDelegate* Create(
      content::WebContents* web_contents);

  virtual ~AwWebContentsViewDelegate();

  // content::WebContentsViewDelegate implementation.
  virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE;
  virtual void ShowContextMenu(
      content::RenderFrameHost* render_frame_host,
      const content::ContextMenuParams& params) OVERRIDE;

 private:
  AwWebContentsViewDelegate(content::WebContents* web_contents);

  // Weak pointer due to ownership graph:
  // WebContents->WebContentsView->this.
  content::WebContents* web_contents_;

  DISALLOW_COPY_AND_ASSIGN(AwWebContentsViewDelegate);
};

}  // namespace android_webview


#endif  // ANDROID_WEBVIEW_NATIVE_AW_WEB_CONTENTS_VIEW_DELEGATE_H_