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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/timer.h" | 11 #include "base/timer.h" |
12 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
13 #include "content/browser/tab_contents/tab_contents_view_helper.h" | 13 #include "content/browser/tab_contents/tab_contents_view_helper.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/web_contents_view.h" | 15 #include "content/public/browser/web_contents_view.h" |
16 #include "ui/base/win/window_impl.h" | 16 #include "ui/base/win/window_impl.h" |
17 | 17 |
18 class RenderWidgetHostViewWin; | 18 class RenderWidgetHostViewWin; |
19 class WebDragDest; | 19 class WebDragDest; |
20 class WebContentsDragWin; | 20 class WebContentsDragWin; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 class WebContentsViewWinDelegate; | 23 class WebContentsViewDelegate; |
24 } | 24 } |
25 | 25 |
26 // An implementation of WebContentsView for Windows. | 26 // An implementation of WebContentsView for Windows. |
27 class CONTENT_EXPORT TabContentsViewWin : public content::WebContentsView, | 27 class CONTENT_EXPORT TabContentsViewWin : public content::WebContentsView, |
28 public ui::WindowImpl { | 28 public ui::WindowImpl { |
29 public: | 29 public: |
30 // TODO(jam): make this take a TabContents once it's created from content. | 30 // TODO(jam): make this take a TabContents once it's created from content. |
31 TabContentsViewWin(content::WebContents* web_contents, | 31 TabContentsViewWin(content::WebContents* web_contents, |
32 content::WebContentsViewWinDelegate* delegate); | 32 content::WebContentsViewDelegate* delegate); |
33 virtual ~TabContentsViewWin(); | 33 virtual ~TabContentsViewWin(); |
34 | 34 |
35 BEGIN_MSG_MAP_EX(TabContentsViewWin) | 35 BEGIN_MSG_MAP_EX(TabContentsViewWin) |
36 MESSAGE_HANDLER(WM_DESTROY, OnDestroy) | 36 MESSAGE_HANDLER(WM_DESTROY, OnDestroy) |
37 MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged) | 37 MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged) |
38 MESSAGE_HANDLER(WM_LBUTTONDOWN, OnMouseDown) | 38 MESSAGE_HANDLER(WM_LBUTTONDOWN, OnMouseDown) |
39 MESSAGE_HANDLER(WM_MBUTTONDOWN, OnMouseDown) | 39 MESSAGE_HANDLER(WM_MBUTTONDOWN, OnMouseDown) |
40 MESSAGE_HANDLER(WM_RBUTTONDOWN, OnMouseDown) | 40 MESSAGE_HANDLER(WM_RBUTTONDOWN, OnMouseDown) |
41 MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) | 41 MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) |
42 MESSAGE_HANDLER(base::win::kReflectedMessage, OnReflectedMessage) | 42 MESSAGE_HANDLER(base::win::kReflectedMessage, OnReflectedMessage) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 LRESULT OnSize( | 123 LRESULT OnSize( |
124 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); | 124 UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); |
125 | 125 |
126 gfx::Size initial_size_; | 126 gfx::Size initial_size_; |
127 | 127 |
128 // The TabContents whose contents we display. | 128 // The TabContents whose contents we display. |
129 TabContents* tab_contents_; | 129 TabContents* tab_contents_; |
130 | 130 |
131 RenderWidgetHostViewWin* view_; | 131 RenderWidgetHostViewWin* view_; |
132 | 132 |
133 scoped_ptr<content::WebContentsViewWinDelegate> delegate_; | 133 scoped_ptr<content::WebContentsViewDelegate> delegate_; |
134 | 134 |
135 // The helper object that handles drag destination related interactions with | 135 // The helper object that handles drag destination related interactions with |
136 // Windows. | 136 // Windows. |
137 scoped_refptr<WebDragDest> drag_dest_; | 137 scoped_refptr<WebDragDest> drag_dest_; |
138 | 138 |
139 // Used to handle the drag-and-drop. | 139 // Used to handle the drag-and-drop. |
140 scoped_refptr<WebContentsDragWin> drag_handler_; | 140 scoped_refptr<WebContentsDragWin> drag_handler_; |
141 | 141 |
142 // Set to true if we want to close the tab after the system drag operation | 142 // Set to true if we want to close the tab after the system drag operation |
143 // has finished. | 143 // has finished. |
144 bool close_tab_after_drag_ends_; | 144 bool close_tab_after_drag_ends_; |
145 | 145 |
146 // Used to close the tab after the stack has unwound. | 146 // Used to close the tab after the stack has unwound. |
147 base::OneShotTimer<TabContentsViewWin> close_tab_timer_; | 147 base::OneShotTimer<TabContentsViewWin> close_tab_timer_; |
148 | 148 |
149 // Common implementations of some WebContentsView methods. | 149 // Common implementations of some WebContentsView methods. |
150 TabContentsViewHelper tab_contents_view_helper_; | 150 TabContentsViewHelper tab_contents_view_helper_; |
151 | 151 |
152 DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); | 152 DISALLOW_COPY_AND_ASSIGN(TabContentsViewWin); |
153 }; | 153 }; |
154 | 154 |
155 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ | 155 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_WIN_H_ |
OLD | NEW |