| 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Rect; | 13 class Rect; |
| 14 class Size; | 14 class Size; |
| 15 } | 15 } |
| 16 namespace IPC { | 16 namespace IPC { |
| 17 class Message; | 17 class Message; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class RenderProcessHost; | 20 class RenderProcessHost; |
| 21 class RenderWidgetHost; | 21 class RenderWidgetHost; |
| 22 class WebCursor; | 22 class WebCursor; |
| 23 | 23 |
| 24 /////////////////////////////////////////////////////////////////////////////// | 24 // RenderWidgetHostView is an interface implemented by an object that acts as |
| 25 // | 25 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its |
| 26 // RenderWidgetHostView | 26 // associated RenderProcessHost own the "Model" in this case which is the |
| 27 // | 27 // child renderer process. The View is responsible for receiving events from |
| 28 // RenderWidgetHostView is an interface implemented by an object that acts as | 28 // the surrounding environment and passing them to the RenderWidgetHost, and |
| 29 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its | 29 // for actually displaying the content of the RenderWidgetHost when it |
| 30 // associated RenderProcessHost own the "Model" in this case which is the | 30 // changes. |
| 31 // child renderer process. The View is responsible for receiving events from | |
| 32 // the surrounding environment and passing them to the RenderWidgetHost, and | |
| 33 // for actually displaying the content of the RenderWidgetHost when it | |
| 34 // changes. | |
| 35 // | |
| 36 /////////////////////////////////////////////////////////////////////////////// | |
| 37 class RenderWidgetHostView { | 31 class RenderWidgetHostView { |
| 38 public: | 32 public: |
| 39 // Platform-specific creator. Use this to construct new RenderWidgetHostViews | 33 // Platform-specific creator. Use this to construct new RenderWidgetHostViews |
| 40 // rather than using RenderWidgetHostViewWin & friends. | 34 // rather than using RenderWidgetHostViewWin & friends. |
| 41 // | 35 // |
| 36 // This function must NOT size it, because the RenderView in the renderer |
| 37 // wounldn't have been created yet. The widget would set its "waiting for |
| 38 // resize ack" flag, and the ack would never come becasue no RenderView |
| 39 // received it. |
| 40 // |
| 42 // The RenderWidgetHost must already be created (because we can't know if it's | 41 // The RenderWidgetHost must already be created (because we can't know if it's |
| 43 // going to be a regular RenderWidgetHost or a RenderViewHost (a subclass). | 42 // going to be a regular RenderWidgetHost or a RenderViewHost (a subclass). |
| 44 static RenderWidgetHostView* CreateViewForWidget(RenderWidgetHost* widget); | 43 static RenderWidgetHostView* CreateViewForWidget(RenderWidgetHost* widget); |
| 45 | 44 |
| 46 // Returns the associated RenderWidgetHost. | 45 // Returns the associated RenderWidgetHost. |
| 47 virtual RenderWidgetHost* GetRenderWidgetHost() const = 0; | 46 virtual RenderWidgetHost* GetRenderWidgetHost() const = 0; |
| 48 | 47 |
| 49 // Notifies the View that it has become visible. | 48 // Notifies the View that it has become visible. |
| 50 virtual void DidBecomeSelected() = 0; | 49 virtual void DidBecomeSelected() = 0; |
| 51 | 50 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 protected: | 113 protected: |
| 115 // Interface class only, do not construct. | 114 // Interface class only, do not construct. |
| 116 RenderWidgetHostView() {} | 115 RenderWidgetHostView() {} |
| 117 | 116 |
| 118 private: | 117 private: |
| 119 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 118 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 120 }; | 119 }; |
| 121 | 120 |
| 122 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 121 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 123 | 122 |
| OLD | NEW |