OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_WEB_CONTENTS_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ |
7 | 7 |
8 #include "base/gfx/size.h" | 8 #include "base/gfx/size.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/browser/tab_contents/web_contents_view.h" | 10 #include "chrome/browser/tab_contents/web_contents_view.h" |
11 #include "chrome/views/widget_win.h" | 11 #include "chrome/views/widget_win.h" |
12 | 12 |
| 13 class DevToolsWindow; |
13 class SadTabView; | 14 class SadTabView; |
14 struct WebDropData; | 15 struct WebDropData; |
15 class WebDropTarget; | 16 class WebDropTarget; |
16 | 17 |
| 18 |
17 // Windows-specific implementation of the WebContentsView. It is a HWND that | 19 // Windows-specific implementation of the WebContentsView. It is a HWND that |
18 // contains all of the contents of the tab and associated child views. | 20 // contains all of the contents of the tab and associated child views. |
19 class WebContentsViewWin : public WebContentsView, | 21 class WebContentsViewWin : public WebContentsView, |
20 public views::WidgetWin { | 22 public views::WidgetWin { |
21 public: | 23 public: |
22 // The corresponding WebContents is passed in the constructor, and manages our | 24 // The corresponding WebContents is passed in the constructor, and manages our |
23 // lifetime. This doesn't need to be the case, but is this way currently | 25 // lifetime. This doesn't need to be the case, but is this way currently |
24 // because that's what was easiest when they were split. | 26 // because that's what was easiest when they were split. |
25 explicit WebContentsViewWin(WebContents* web_contents); | 27 explicit WebContentsViewWin(WebContents* web_contents); |
26 virtual ~WebContentsViewWin(); | 28 virtual ~WebContentsViewWin(); |
27 | 29 |
28 // WebContentsView implementation -------------------------------------------- | 30 // WebContentsView implementation -------------------------------------------- |
29 | 31 |
30 virtual WebContents* GetWebContents(); | 32 virtual WebContents* GetWebContents(); |
31 virtual void CreateView(); | 33 virtual void CreateView(); |
32 virtual RenderWidgetHostView* CreateViewForWidget( | 34 virtual RenderWidgetHostView* CreateViewForWidget( |
33 RenderWidgetHost* render_widget_host); | 35 RenderWidgetHost* render_widget_host); |
34 virtual gfx::NativeView GetNativeView() const; | 36 virtual gfx::NativeView GetNativeView() const; |
35 virtual gfx::NativeView GetContentNativeView() const; | 37 virtual gfx::NativeView GetContentNativeView() const; |
36 virtual gfx::NativeWindow GetTopLevelNativeView() const; | 38 virtual gfx::NativeWindow GetTopLevelNativeView() const; |
37 virtual void GetContainerBounds(gfx::Rect* out) const; | 39 virtual void GetContainerBounds(gfx::Rect* out) const; |
38 virtual void OnContentsDestroy(); | 40 virtual void OnContentsDestroy(); |
39 virtual void SetPageTitle(const std::wstring& title); | 41 virtual void SetPageTitle(const std::wstring& title); |
40 virtual void Invalidate(); | 42 virtual void Invalidate(); |
41 virtual void SizeContents(const gfx::Size& size); | 43 virtual void SizeContents(const gfx::Size& size); |
| 44 virtual void OpenDeveloperTools(); |
| 45 virtual void ForwardMessageToDevToolsClient(const IPC::Message& message); |
42 | 46 |
43 // Backend implementation of RenderViewHostDelegate::View. | 47 // Backend implementation of RenderViewHostDelegate::View. |
44 virtual WebContents* CreateNewWindowInternal( | 48 virtual WebContents* CreateNewWindowInternal( |
45 int route_id, base::WaitableEvent* modal_dialog_event); | 49 int route_id, base::WaitableEvent* modal_dialog_event); |
46 virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id, | 50 virtual RenderWidgetHostView* CreateNewWidgetInternal(int route_id, |
47 bool activatable); | 51 bool activatable); |
48 virtual void ShowCreatedWindowInternal(WebContents* new_web_contents, | 52 virtual void ShowCreatedWindowInternal(WebContents* new_web_contents, |
49 WindowOpenDisposition disposition, | 53 WindowOpenDisposition disposition, |
50 const gfx::Rect& initial_pos, | 54 const gfx::Rect& initial_pos, |
51 bool user_gesture); | 55 bool user_gesture); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void WasSized(const gfx::Size& size); | 93 void WasSized(const gfx::Size& size); |
90 | 94 |
91 // TODO(brettw) comment these. They're confusing. | 95 // TODO(brettw) comment these. They're confusing. |
92 bool ScrollZoom(int scroll_type); | 96 bool ScrollZoom(int scroll_type); |
93 void WheelZoom(int distance); | 97 void WheelZoom(int distance); |
94 | 98 |
95 // --------------------------------------------------------------------------- | 99 // --------------------------------------------------------------------------- |
96 | 100 |
97 WebContents* web_contents_; | 101 WebContents* web_contents_; |
98 | 102 |
| 103 // Allows to show exactly one developer tools window for this page. |
| 104 scoped_ptr<DevToolsWindow> dev_tools_window_; |
| 105 |
99 // A drop target object that handles drags over this WebContents. | 106 // A drop target object that handles drags over this WebContents. |
100 scoped_refptr<WebDropTarget> drop_target_; | 107 scoped_refptr<WebDropTarget> drop_target_; |
101 | 108 |
102 // Used to render the sad tab. This will be non-NULL only when the sad tab is | 109 // Used to render the sad tab. This will be non-NULL only when the sad tab is |
103 // visible. | 110 // visible. |
104 scoped_ptr<SadTabView> sad_tab_; | 111 scoped_ptr<SadTabView> sad_tab_; |
105 | 112 |
106 // Whether to ignore the next CHAR keyboard event. | 113 // Whether to ignore the next CHAR keyboard event. |
107 bool ignore_next_char_event_; | 114 bool ignore_next_char_event_; |
108 | 115 |
109 DISALLOW_COPY_AND_ASSIGN(WebContentsViewWin); | 116 DISALLOW_COPY_AND_ASSIGN(WebContentsViewWin); |
110 }; | 117 }; |
111 | 118 |
112 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ | 119 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_VIEW_WIN_H_ |
OLD | NEW |