| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/browser/web_contents_view_delegate.h" | 11 #include "content/public/browser/web_contents_view_delegate.h" |
| 12 #include "ui/base/gtk/gtk_signal.h" | 12 #include "ui/base/gtk/gtk_signal.h" |
| 13 #include "ui/base/gtk/owned_widget_gtk.h" | 13 #include "ui/base/gtk/owned_widget_gtk.h" |
| 14 | 14 |
| 15 class ConstrainedWindowGtk; | 15 class ConstrainedWindowGtk; |
| 16 class RenderViewContextMenuGtk; | 16 class RenderViewContextMenuGtk; |
| 17 class WebDragBookmarkHandlerGtk; | 17 class WebDragBookmarkHandlerGtk; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class WebContents; | 20 class WebContents; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // A chrome/ specific class that extends TabContentsViewGtk with features like | 23 // A chrome/ specific class that extends WebContentsViewGtk with features like |
| 24 // constrained windows, which live in chrome/. | 24 // constrained windows, which live in chrome/. |
| 25 class ChromeWebContentsViewDelegateGtk | 25 class ChromeWebContentsViewDelegateGtk |
| 26 : public content::WebContentsViewDelegate { | 26 : public content::WebContentsViewDelegate { |
| 27 public: | 27 public: |
| 28 explicit ChromeWebContentsViewDelegateGtk(content::WebContents* web_contents); | 28 explicit ChromeWebContentsViewDelegateGtk(content::WebContents* web_contents); |
| 29 virtual ~ChromeWebContentsViewDelegateGtk(); | 29 virtual ~ChromeWebContentsViewDelegateGtk(); |
| 30 | 30 |
| 31 static ChromeWebContentsViewDelegateGtk* GetFor( | 31 static ChromeWebContentsViewDelegateGtk* GetFor( |
| 32 content::WebContents* web_contents); | 32 content::WebContents* web_contents); |
| 33 | 33 |
| 34 GtkWidget* expanded_container() { return expanded_container_; } | 34 GtkWidget* expanded_container() { return expanded_container_; } |
| 35 ui::FocusStoreGtk* focus_store() { return focus_store_; } | 35 ui::FocusStoreGtk* focus_store() { return focus_store_; } |
| 36 | 36 |
| 37 // Unlike Windows, ConstrainedWindows need to collaborate with the | 37 // Unlike Windows, ConstrainedWindows need to collaborate with the |
| 38 // TabContentsViewGtk to position the dialogs. | 38 // WebContentsViewGtk to position the dialogs. |
| 39 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); | 39 void AttachConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 40 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); | 40 void RemoveConstrainedWindow(ConstrainedWindowGtk* constrained_window); |
| 41 | 41 |
| 42 // Overridden from WebContentsViewDelegate: | 42 // Overridden from WebContentsViewDelegate: |
| 43 virtual void ShowContextMenu( | 43 virtual void ShowContextMenu( |
| 44 const content::ContextMenuParams& params) OVERRIDE; | 44 const content::ContextMenuParams& params) OVERRIDE; |
| 45 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; | 45 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; |
| 46 virtual void Initialize(GtkWidget* expanded_container, | 46 virtual void Initialize(GtkWidget* expanded_container, |
| 47 ui::FocusStoreGtk* focus_store) OVERRIDE; | 47 ui::FocusStoreGtk* focus_store) OVERRIDE; |
| 48 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 48 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 // The chrome specific delegate that receives events from WebDragDestGtk. | 71 // The chrome specific delegate that receives events from WebDragDestGtk. |
| 72 scoped_ptr<WebDragBookmarkHandlerGtk> bookmark_handler_gtk_; | 72 scoped_ptr<WebDragBookmarkHandlerGtk> bookmark_handler_gtk_; |
| 73 | 73 |
| 74 content::WebContents* web_contents_; | 74 content::WebContents* web_contents_; |
| 75 | 75 |
| 76 GtkWidget* expanded_container_; | 76 GtkWidget* expanded_container_; |
| 77 ui::FocusStoreGtk* focus_store_; | 77 ui::FocusStoreGtk* focus_store_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ | 80 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_ |
| OLD | NEW |