diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/content/shell/browser/shell_web_contents_view_delegate.h | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/content/shell/browser/shell_web_contents_view_delegate.h')
-rw-r--r-- | chromium/content/shell/browser/shell_web_contents_view_delegate.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/chromium/content/shell/browser/shell_web_contents_view_delegate.h b/chromium/content/shell/browser/shell_web_contents_view_delegate.h new file mode 100644 index 00000000000..86d97b407b0 --- /dev/null +++ b/chromium/content/shell/browser/shell_web_contents_view_delegate.h @@ -0,0 +1,83 @@ +// Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ +#define CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ + +#include "content/public/browser/web_contents.h" +#include "content/public/browser/web_contents_view_delegate.h" +#include "content/public/common/context_menu_params.h" + +#if defined(TOOLKIT_GTK) +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/owned_widget_gtk.h" +#endif + +namespace content { + +class ShellWebContentsViewDelegate : public WebContentsViewDelegate { + public: + explicit ShellWebContentsViewDelegate(WebContents* web_contents); + virtual ~ShellWebContentsViewDelegate(); + + // Overridden from WebContentsViewDelegate: + virtual void ShowContextMenu(const ContextMenuParams& params) OVERRIDE; + virtual WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; + +#if defined(TOOLKIT_GTK) + virtual void Initialize(GtkWidget* expanded_container, + ui::FocusStoreGtk* focus_store) OVERRIDE; + virtual gfx::NativeView GetNativeView() const OVERRIDE; + virtual void Focus() OVERRIDE; + virtual gboolean OnNativeViewFocusEvent(GtkWidget* widget, + GtkDirectionType type, + gboolean* return_value) OVERRIDE; +#elif defined(OS_MACOSX) + virtual NSObject<RenderWidgetHostViewMacDelegate>* + CreateRenderWidgetHostViewDelegate( + RenderWidgetHost* render_widget_host) OVERRIDE; + void ActionPerformed(int id); +#elif defined(OS_WIN) + virtual void StoreFocus() OVERRIDE; + virtual void RestoreFocus() OVERRIDE; + virtual bool Focus() OVERRIDE; + virtual void TakeFocus(bool reverse) OVERRIDE; + virtual void SizeChanged(const gfx::Size& size) OVERRIDE; + void MenuItemSelected(int selection); +#endif + + private: + WebContents* web_contents_; + ContextMenuParams params_; + +#if defined(TOOLKIT_GTK) + ui::OwnedWidgetGtk floating_; + GtkWidget* expanded_container_; + + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnBackMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnForwardMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnReloadMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnOpenURLMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnCutMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnCopyMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnPasteMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnDeleteMenuActivated); + CHROMEGTK_CALLBACK_0(ShellWebContentsViewDelegate, void, + OnInspectMenuActivated); +#endif + + DISALLOW_COPY_AND_ASSIGN(ShellWebContentsViewDelegate); +}; + +} // namespace content + +#endif // CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_ |