[WRTjs] Refactor popup
[platform/framework/web/chromium-efl.git] / wrt / src / browser / wrt_web_contents_view_delegate.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #ifndef BROWSER_WRT_WEB_CONTENTS_VIEW_DELEGATE_H_
18 #define BROWSER_WRT_WEB_CONTENTS_VIEW_DELEGATE_H_
19
20 #include "content/public/browser/web_contents_view_delegate.h"
21 #include "ui/gfx/geometry/rect.h"
22
23 namespace content {
24 class WebContents;
25 }
26
27 namespace wrt {
28
29 class WRTWebContentsViewDelegate : public content::WebContentsViewDelegate {
30  public:
31   explicit WRTWebContentsViewDelegate(content::WebContents* web_contents);
32   ~WRTWebContentsViewDelegate();
33
34   WRTWebContentsViewDelegate(const WRTWebContentsViewDelegate&) = delete;
35   WRTWebContentsViewDelegate& operator=(const WRTWebContentsViewDelegate&)
36       = delete;
37
38  private:
39   // content::WebContentsViewDelegate
40   bool Focus() override;
41   void ShowContextMenu(content::RenderFrameHost& render_frame_host,
42                        const content::ContextMenuParams& params) override;
43   void OnSelectionRectReceived(const gfx::Rect& selection_rect) const override;
44
45   content::WebContents* web_contents_;
46 };
47
48 } // namespace wrt
49
50 #endif // BROWSER_WRT_WEB_CONTENTS_VIEW_DELEGATE_H_