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_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_V
IEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_V
IEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_V
IEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_V
IEWS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // focus management, which live in chrome. | 34 // focus management, which live in chrome. |
35 class ChromeWebContentsViewDelegateViews | 35 class ChromeWebContentsViewDelegateViews |
36 : public content::WebContentsViewDelegate, | 36 : public content::WebContentsViewDelegate, |
37 public ContextMenuDelegate { | 37 public ContextMenuDelegate { |
38 public: | 38 public: |
39 explicit ChromeWebContentsViewDelegateViews( | 39 explicit ChromeWebContentsViewDelegateViews( |
40 content::WebContents* web_contents); | 40 content::WebContents* web_contents); |
41 virtual ~ChromeWebContentsViewDelegateViews(); | 41 virtual ~ChromeWebContentsViewDelegateViews(); |
42 | 42 |
43 // Overridden from WebContentsViewDelegate: | 43 // Overridden from WebContentsViewDelegate: |
44 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; | 44 virtual content::WebDragDestDelegate* GetDragDestDelegate() override; |
45 virtual void StoreFocus() OVERRIDE; | 45 virtual void StoreFocus() override; |
46 virtual void RestoreFocus() OVERRIDE; | 46 virtual void RestoreFocus() override; |
47 virtual bool Focus() OVERRIDE; | 47 virtual bool Focus() override; |
48 virtual void TakeFocus(bool reverse) OVERRIDE; | 48 virtual void TakeFocus(bool reverse) override; |
49 virtual void ShowContextMenu( | 49 virtual void ShowContextMenu( |
50 content::RenderFrameHost* render_frame_host, | 50 content::RenderFrameHost* render_frame_host, |
51 const content::ContextMenuParams& params) OVERRIDE; | 51 const content::ContextMenuParams& params) override; |
52 virtual void SizeChanged(const gfx::Size& size) OVERRIDE; | 52 virtual void SizeChanged(const gfx::Size& size) override; |
53 virtual void ShowDisambiguationPopup( | 53 virtual void ShowDisambiguationPopup( |
54 const gfx::Rect& target_rect, | 54 const gfx::Rect& target_rect, |
55 const SkBitmap& zoomed_bitmap, | 55 const SkBitmap& zoomed_bitmap, |
56 const gfx::NativeView content, | 56 const gfx::NativeView content, |
57 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, | 57 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, |
58 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) OVERRIDE; | 58 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) override; |
59 virtual void HideDisambiguationPopup() OVERRIDE; | 59 virtual void HideDisambiguationPopup() override; |
60 | 60 |
61 // Overridden from ContextMenuDelegate. | 61 // Overridden from ContextMenuDelegate. |
62 virtual scoped_ptr<RenderViewContextMenu> BuildMenu( | 62 virtual scoped_ptr<RenderViewContextMenu> BuildMenu( |
63 content::WebContents* web_contents, | 63 content::WebContents* web_contents, |
64 const content::ContextMenuParams& params) OVERRIDE; | 64 const content::ContextMenuParams& params) override; |
65 virtual void ShowMenu(scoped_ptr<RenderViewContextMenu> menu) OVERRIDE; | 65 virtual void ShowMenu(scoped_ptr<RenderViewContextMenu> menu) override; |
66 | 66 |
67 private: | 67 private: |
68 aura::Window* GetActiveNativeView(); | 68 aura::Window* GetActiveNativeView(); |
69 views::Widget* GetTopLevelWidget(); | 69 views::Widget* GetTopLevelWidget(); |
70 views::FocusManager* GetFocusManager(); | 70 views::FocusManager* GetFocusManager(); |
71 void SetInitialFocus(); | 71 void SetInitialFocus(); |
72 | 72 |
73 // The id used in the ViewStorage to store the last focused view. | 73 // The id used in the ViewStorage to store the last focused view. |
74 int last_focused_view_storage_id_; | 74 int last_focused_view_storage_id_; |
75 | 75 |
76 // The context menu is reset every time we show it, but we keep a pointer to | 76 // The context menu is reset every time we show it, but we keep a pointer to |
77 // between uses so that it won't go out of scope before we're done with it. | 77 // between uses so that it won't go out of scope before we're done with it. |
78 scoped_ptr<RenderViewContextMenuViews> context_menu_; | 78 scoped_ptr<RenderViewContextMenuViews> context_menu_; |
79 | 79 |
80 // The chrome specific delegate that receives events from WebDragDest. | 80 // The chrome specific delegate that receives events from WebDragDest. |
81 scoped_ptr<content::WebDragDestDelegate> bookmark_handler_; | 81 scoped_ptr<content::WebDragDestDelegate> bookmark_handler_; |
82 | 82 |
83 content::WebContents* web_contents_; | 83 content::WebContents* web_contents_; |
84 | 84 |
85 scoped_ptr<LinkDisambiguationPopup> link_disambiguation_popup_; | 85 scoped_ptr<LinkDisambiguationPopup> link_disambiguation_popup_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateViews); | 87 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateViews); |
88 }; | 88 }; |
89 | 89 |
90 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGAT
E_VIEWS_H_ | 90 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGAT
E_VIEWS_H_ |
OLD | NEW |