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_WIN_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_WIN_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/public/browser/web_contents_view_delegate.h" | 12 #include "content/public/browser/web_contents_view_delegate.h" |
13 | 13 |
14 class ConstrainedWindowViews; | 14 class ConstrainedWindowViews; |
15 class RenderViewContextMenuViews; | 15 class RenderViewContextMenuViews; |
16 class WebDragBookmarkHandlerWin; | |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 class WebContents; | 18 class WebContents; |
19 content::WebDragDestDelegate; | |
jam
2012/04/03 17:29:27
did you mean "class WebDragDestDelegate;"?
| |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 class FocusManager; | 23 class FocusManager; |
24 class Widget; | 24 class Widget; |
25 } | 25 } |
26 | 26 |
27 // A chrome specific class that extends TabContentsViewWin with features like | 27 // A chrome specific class that extends TabContentsViewWin with features like |
28 // constrained windows, which live in chrome. | 28 // constrained windows, which live in chrome. |
29 class ChromeWebContentsViewDelegateWin | 29 class ChromeWebContentsViewDelegateViews |
30 : public content::WebContentsViewDelegate { | 30 : public content::WebContentsViewDelegate { |
31 public: | 31 public: |
32 explicit ChromeWebContentsViewDelegateWin(content::WebContents* web_contents); | 32 explicit ChromeWebContentsViewDelegateViews( |
33 virtual ~ChromeWebContentsViewDelegateWin(); | 33 content::WebContents* web_contents); |
34 virtual ~ChromeWebContentsViewDelegateViews(); | |
34 | 35 |
35 // Overridden from WebContentsViewDelegate: | 36 // Overridden from WebContentsViewDelegate: |
36 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; | 37 virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE; |
37 virtual void StoreFocus() OVERRIDE; | 38 virtual void StoreFocus() OVERRIDE; |
38 virtual void RestoreFocus() OVERRIDE; | 39 virtual void RestoreFocus() OVERRIDE; |
39 virtual bool Focus() OVERRIDE; | 40 virtual bool Focus() OVERRIDE; |
40 virtual void TakeFocus(bool reverse) OVERRIDE; | 41 virtual void TakeFocus(bool reverse) OVERRIDE; |
41 virtual void ShowContextMenu( | 42 virtual void ShowContextMenu( |
42 const content::ContextMenuParams& params) OVERRIDE; | 43 const content::ContextMenuParams& params) OVERRIDE; |
43 virtual void SizeChanged(const gfx::Size& size) OVERRIDE; | 44 virtual void SizeChanged(const gfx::Size& size) OVERRIDE; |
44 | 45 |
45 private: | 46 private: |
46 views::Widget* GetTopLevelWidget(); | 47 views::Widget* GetTopLevelWidget(); |
47 views::FocusManager* GetFocusManager(); | 48 views::FocusManager* GetFocusManager(); |
48 void SetInitialFocus(); | 49 void SetInitialFocus(); |
49 | 50 |
50 // The id used in the ViewStorage to store the last focused view. | 51 // The id used in the ViewStorage to store the last focused view. |
51 int last_focused_view_storage_id_; | 52 int last_focused_view_storage_id_; |
52 | 53 |
53 // The context menu is reset every time we show it, but we keep a pointer to | 54 // The context menu is reset every time we show it, but we keep a pointer to |
54 // between uses so that it won't go out of scope before we're done with it. | 55 // between uses so that it won't go out of scope before we're done with it. |
55 scoped_ptr<RenderViewContextMenuViews> context_menu_; | 56 scoped_ptr<RenderViewContextMenuViews> context_menu_; |
56 | 57 |
57 // The chrome specific delegate that receives events from WebDragDest. | 58 // The chrome specific delegate that receives events from WebDragDest. |
58 scoped_ptr<WebDragBookmarkHandlerWin> bookmark_handler_; | 59 scoped_ptr<content::WebDragDestDelegate> bookmark_handler_; |
59 | 60 |
60 content::WebContents* web_contents_; | 61 content::WebContents* web_contents_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateWin); | 63 DISALLOW_COPY_AND_ASSIGN(ChromeWebContentsViewDelegateViews); |
63 }; | 64 }; |
64 | 65 |
65 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_WIN_H_ | 66 #endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_VIEWS_H _ |
OLD | NEW |