| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 #include <atlapp.h> | 10 #include <atlapp.h> |
| 11 #include <atlcrack.h> | 11 #include <atlcrack.h> |
| 12 #include <atlmisc.h> | 12 #include <atlmisc.h> |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 18 #include "base/task.h" | 19 #include "base/task.h" |
| 19 #include "base/win/scoped_comptr.h" | 20 #include "base/win/scoped_comptr.h" |
| 20 #include "content/browser/accessibility/browser_accessibility_manager.h" | 21 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 21 #include "content/browser/renderer_host/render_widget_host_view.h" | 22 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 23 #include "content/common/content_export.h" |
| 22 #include "content/common/notification_observer.h" | 24 #include "content/common/notification_observer.h" |
| 23 #include "content/common/notification_registrar.h" | 25 #include "content/common/notification_registrar.h" |
| 24 #include "ui/base/win/ime_input.h" | 26 #include "ui/base/win/ime_input.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
| 26 #include "webkit/glue/webcursor.h" | 28 #include "webkit/glue/webcursor.h" |
| 27 | 29 |
| 28 class BackingStore; | 30 class BackingStore; |
| 29 class RenderWidgetHost; | 31 class RenderWidgetHost; |
| 30 | 32 |
| 31 namespace gfx { | 33 namespace gfx { |
| 32 class Size; | 34 class Size; |
| 33 class Rect; | 35 class Rect; |
| 34 } | 36 } |
| 35 | 37 |
| 36 namespace IPC { | 38 namespace IPC { |
| 37 class Message; | 39 class Message; |
| 38 } | 40 } |
| 39 | 41 |
| 40 namespace ui { | 42 namespace ui { |
| 41 class ViewProp; | 43 class ViewProp; |
| 42 } | 44 } |
| 43 | 45 |
| 44 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> | 46 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> |
| 45 RenderWidgetHostHWNDTraits; | 47 RenderWidgetHostHWNDTraits; |
| 46 | 48 |
| 47 extern const wchar_t kRenderWidgetHostHWNDClass[]; | 49 CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[]; |
| 48 | 50 |
| 49 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
| 50 // RenderWidgetHostViewWin | 52 // RenderWidgetHostViewWin |
| 51 // | 53 // |
| 52 // An object representing the "View" of a rendered web page. This object is | 54 // An object representing the "View" of a rendered web page. This object is |
| 53 // responsible for displaying the content of the web page, receiving windows | 55 // responsible for displaying the content of the web page, receiving windows |
| 54 // messages, and containing plugins HWNDs. It is the implementation of the | 56 // messages, and containing plugins HWNDs. It is the implementation of the |
| 55 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses | 57 // RenderWidgetHostView that the cross-platform RenderWidgetHost object uses |
| 56 // to display the data. | 58 // to display the data. |
| 57 // | 59 // |
| 58 // Comment excerpted from render_widget_host.h: | 60 // Comment excerpted from render_widget_host.h: |
| 59 // | 61 // |
| 60 // "The lifetime of the RenderWidgetHostHWND is tied to the render process. | 62 // "The lifetime of the RenderWidgetHostHWND is tied to the render process. |
| 61 // If the render process dies, the RenderWidgetHostHWND goes away and all | 63 // If the render process dies, the RenderWidgetHostHWND goes away and all |
| 62 // references to it must become NULL." | 64 // references to it must become NULL." |
| 63 // | 65 // |
| 64 class RenderWidgetHostViewWin | 66 class RenderWidgetHostViewWin |
| 65 : public CWindowImpl<RenderWidgetHostViewWin, | 67 : public CWindowImpl<RenderWidgetHostViewWin, |
| 66 CWindow, | 68 CWindow, |
| 67 RenderWidgetHostHWNDTraits>, | 69 RenderWidgetHostHWNDTraits>, |
| 68 public RenderWidgetHostView, | 70 public RenderWidgetHostView, |
| 69 public NotificationObserver, | 71 public NotificationObserver, |
| 70 public BrowserAccessibilityDelegate { | 72 public BrowserAccessibilityDelegate { |
| 71 public: | 73 public: |
| 72 // The view will associate itself with the given widget. | 74 // The view will associate itself with the given widget. |
| 73 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); | 75 CONTENT_EXPORT explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); |
| 74 virtual ~RenderWidgetHostViewWin(); | 76 virtual ~RenderWidgetHostViewWin(); |
| 75 | 77 |
| 76 void CreateWnd(HWND parent); | 78 CONTENT_EXPORT void CreateWnd(HWND parent); |
| 77 | 79 |
| 78 void ScheduleComposite(); | 80 void ScheduleComposite(); |
| 79 | 81 |
| 80 IAccessible* GetIAccessible(); | 82 CONTENT_EXPORT IAccessible* GetIAccessible(); |
| 81 | 83 |
| 82 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); | 84 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); |
| 83 | 85 |
| 84 BEGIN_MSG_MAP(RenderWidgetHostHWND) | 86 BEGIN_MSG_MAP(RenderWidgetHostHWND) |
| 85 MSG_WM_CREATE(OnCreate) | 87 MSG_WM_CREATE(OnCreate) |
| 86 MSG_WM_ACTIVATE(OnActivate) | 88 MSG_WM_ACTIVATE(OnActivate) |
| 87 MSG_WM_DESTROY(OnDestroy) | 89 MSG_WM_DESTROY(OnDestroy) |
| 88 MSG_WM_PAINT(OnPaint) | 90 MSG_WM_PAINT(OnPaint) |
| 89 MSG_WM_NCPAINT(OnNCPaint) | 91 MSG_WM_NCPAINT(OnNCPaint) |
| 90 MSG_WM_ERASEBKGND(OnEraseBkgnd) | 92 MSG_WM_ERASEBKGND(OnEraseBkgnd) |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 382 |
| 381 ScopedVector<ui::ViewProp> props_; | 383 ScopedVector<ui::ViewProp> props_; |
| 382 | 384 |
| 383 // Is the widget fullscreen? | 385 // Is the widget fullscreen? |
| 384 bool is_fullscreen_; | 386 bool is_fullscreen_; |
| 385 | 387 |
| 386 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 388 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
| 387 }; | 389 }; |
| 388 | 390 |
| 389 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 391 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| OLD | NEW |