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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ | |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ | |
7 #pragma once | |
8 | |
9 #include <gtk/gtk.h> | |
10 | |
11 #include "content/common/content_export.h" | |
12 #include "ui/gfx/native_widget_types.h" | |
13 | |
14 | |
15 namespace content { | |
16 | |
17 class TabContentsViewGtk; | |
18 struct ContextMenuParams; | |
19 | |
20 // An object that supplies the Gtk parent of TabContentsViewGtk. Embedders may | |
21 // want to insert widgets that provide features that live with the | |
22 // TabContentsViewGtk. | |
23 class CONTENT_EXPORT TabContentsViewWrapperGtk { | |
24 public: | |
25 // Initializes the TabContentsViewGtkWrapper by taking |view| and adding it | |
26 // this object's GtkContainer. | |
27 virtual void WrapView(TabContentsViewGtk* view) = 0; | |
28 | |
29 // Returns the top widget that contains |view| passed in from WrapView. This | |
30 // is exposed through TabContentsViewGtk::GetNativeView() when a wrapper is | |
31 // supplied to a TabContentsViewGtk. | |
32 virtual gfx::NativeView GetNativeView() const = 0; | |
33 | |
34 // Called during the TabContentsViewGtk. Used to associate drag handlers. | |
35 virtual void OnCreateViewForWidget() = 0; | |
36 | |
37 // Handles a focus event from the renderer process. | |
38 virtual void Focus() = 0; | |
39 | |
40 // Gives TabContentsViewGtkWrapper a first chance at focus events from our | |
41 // render widget host, before the main view invokes its default | |
42 // behaviour. Returns TRUE if |return_value| has been set and that value | |
43 // should be returned to GTK+. | |
44 virtual gboolean OnNativeViewFocusEvent(GtkWidget* widget, | |
45 GtkDirectionType type, | |
46 gboolean* return_value) = 0; | |
47 | |
48 // Complete hack because I have no idea where else to put this platform | |
49 // specific crud. | |
50 virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; | |
51 | |
52 virtual ~TabContentsViewWrapperGtk() {} | |
53 }; | |
54 | |
55 } // namespace content | |
56 | |
57 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WRAPPER_GTK_H_ | |
OLD | NEW |