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 <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "components/renderer_context_menu/context_menu_delegate.h" | 12 #include "components/renderer_context_menu/context_menu_delegate.h" |
12 #include "content/public/browser/web_contents_view_delegate.h" | 13 #include "content/public/browser/web_contents_view_delegate.h" |
13 | 14 |
14 class LinkDisambiguationPopup; | 15 class LinkDisambiguationPopup; |
15 class RenderViewContextMenuBase; | 16 class RenderViewContextMenuBase; |
16 | 17 |
17 namespace aura { | 18 namespace aura { |
18 class Window; | 19 class Window; |
19 } | 20 } |
20 | 21 |
(...skipping 30 matching lines...) Expand all Loading... |
51 void SizeChanged(const gfx::Size& size) override; | 52 void SizeChanged(const gfx::Size& size) override; |
52 void ShowDisambiguationPopup( | 53 void ShowDisambiguationPopup( |
53 const gfx::Rect& target_rect, | 54 const gfx::Rect& target_rect, |
54 const SkBitmap& zoomed_bitmap, | 55 const SkBitmap& zoomed_bitmap, |
55 const gfx::NativeView content, | 56 const gfx::NativeView content, |
56 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, | 57 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, |
57 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) override; | 58 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) override; |
58 void HideDisambiguationPopup() override; | 59 void HideDisambiguationPopup() override; |
59 | 60 |
60 // Overridden from ContextMenuDelegate. | 61 // Overridden from ContextMenuDelegate. |
61 scoped_ptr<RenderViewContextMenuBase> BuildMenu( | 62 std::unique_ptr<RenderViewContextMenuBase> BuildMenu( |
62 content::WebContents* web_contents, | 63 content::WebContents* web_contents, |
63 const content::ContextMenuParams& params) override; | 64 const content::ContextMenuParams& params) override; |
64 void ShowMenu(scoped_ptr<RenderViewContextMenuBase> menu) override; | 65 void ShowMenu(std::unique_ptr<RenderViewContextMenuBase> menu) override; |
65 | 66 |
66 private: | 67 private: |
67 aura::Window* GetActiveNativeView(); | 68 aura::Window* GetActiveNativeView(); |
68 views::Widget* GetTopLevelWidget(); | 69 views::Widget* GetTopLevelWidget(); |
69 views::FocusManager* GetFocusManager(); | 70 views::FocusManager* GetFocusManager(); |
70 void SetInitialFocus(); | 71 void SetInitialFocus(); |
71 | 72 |
72 // 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. |
73 int last_focused_view_storage_id_; | 74 int last_focused_view_storage_id_; |
74 | 75 |
75 // 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 |
76 // 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. |
77 scoped_ptr<RenderViewContextMenuBase> context_menu_; | 78 std::unique_ptr<RenderViewContextMenuBase> context_menu_; |
78 | 79 |
79 // The chrome specific delegate that receives events from WebDragDest. | 80 // The chrome specific delegate that receives events from WebDragDest. |
80 scoped_ptr<content::WebDragDestDelegate> bookmark_handler_; | 81 std::unique_ptr<content::WebDragDestDelegate> bookmark_handler_; |
81 | 82 |
82 content::WebContents* web_contents_; | 83 content::WebContents* web_contents_; |
83 | 84 |
84 scoped_ptr<LinkDisambiguationPopup> link_disambiguation_popup_; | 85 std::unique_ptr<LinkDisambiguationPopup> link_disambiguation_popup_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateViews); | 87 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateViews); |
87 }; | 88 }; |
88 | 89 |
89 #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 |