| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include <OpenGL/OpenGL.h> | 10 #include <OpenGL/OpenGL.h> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // RenderWidgetHostView is an interface implemented by an object that acts as | 45 // RenderWidgetHostView is an interface implemented by an object that acts as |
| 46 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its | 46 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its |
| 47 // associated RenderProcessHost own the "Model" in this case which is the | 47 // associated RenderProcessHost own the "Model" in this case which is the |
| 48 // child renderer process. The View is responsible for receiving events from | 48 // child renderer process. The View is responsible for receiving events from |
| 49 // the surrounding environment and passing them to the RenderWidgetHost, and | 49 // the surrounding environment and passing them to the RenderWidgetHost, and |
| 50 // for actually displaying the content of the RenderWidgetHost when it | 50 // for actually displaying the content of the RenderWidgetHost when it |
| 51 // changes. | 51 // changes. |
| 52 class RenderWidgetHostView { | 52 class RenderWidgetHostView { |
| 53 public: | 53 public: |
| 54 virtual ~RenderWidgetHostView() {} | 54 virtual ~RenderWidgetHostView(); |
| 55 | 55 |
| 56 // Platform-specific creator. Use this to construct new RenderWidgetHostViews | 56 // Platform-specific creator. Use this to construct new RenderWidgetHostViews |
| 57 // rather than using RenderWidgetHostViewWin & friends. | 57 // rather than using RenderWidgetHostViewWin & friends. |
| 58 // | 58 // |
| 59 // This function must NOT size it, because the RenderView in the renderer | 59 // This function must NOT size it, because the RenderView in the renderer |
| 60 // wounldn't have been created yet. The widget would set its "waiting for | 60 // wounldn't have been created yet. The widget would set its "waiting for |
| 61 // resize ack" flag, and the ack would never come becasue no RenderView | 61 // resize ack" flag, and the ack would never come becasue no RenderView |
| 62 // received it. | 62 // received it. |
| 63 // | 63 // |
| 64 // The RenderWidgetHost must already be created (because we can't know if it's | 64 // The RenderWidgetHost must already be created (because we can't know if it's |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // gradually fades in; otherwise it takes effect immediately. To remove the | 261 // gradually fades in; otherwise it takes effect immediately. To remove the |
| 262 // fade effect, pass a NULL value for |color|. In this case, |animate| is | 262 // fade effect, pass a NULL value for |color|. In this case, |animate| is |
| 263 // ignored. | 263 // ignored. |
| 264 virtual void SetVisuallyDeemphasized(const SkColor* color, bool animate) = 0; | 264 virtual void SetVisuallyDeemphasized(const SkColor* color, bool animate) = 0; |
| 265 | 265 |
| 266 void set_popup_type(WebKit::WebPopupType popup_type) { | 266 void set_popup_type(WebKit::WebPopupType popup_type) { |
| 267 popup_type_ = popup_type; | 267 popup_type_ = popup_type; |
| 268 } | 268 } |
| 269 WebKit::WebPopupType popup_type() const { return popup_type_; } | 269 WebKit::WebPopupType popup_type() const { return popup_type_; } |
| 270 | 270 |
| 271 // Subclasses should override this method to do is appropriate to set | 271 // Subclasses should override this method to do what is appropriate to set |
| 272 // the custom background for their platform. | 272 // the custom background for their platform. |
| 273 virtual void SetBackground(const SkBitmap& background) { | 273 virtual void SetBackground(const SkBitmap& background); |
| 274 background_ = background; | |
| 275 } | |
| 276 const SkBitmap& background() const { return background_; } | 274 const SkBitmap& background() const { return background_; } |
| 277 | 275 |
| 278 // Returns true if the native view, |native_view|, is contained within in the | 276 // Returns true if the native view, |native_view|, is contained within in the |
| 279 // widget associated with this RenderWidgetHostView. | 277 // widget associated with this RenderWidgetHostView. |
| 280 virtual bool ContainsNativeView(gfx::NativeView native_view) const = 0; | 278 virtual bool ContainsNativeView(gfx::NativeView native_view) const = 0; |
| 281 | 279 |
| 282 virtual void UpdateAccessibilityTree( | 280 virtual void UpdateAccessibilityTree( |
| 283 const webkit_glue::WebAccessibility& tree) { } | 281 const webkit_glue::WebAccessibility& tree) { } |
| 284 virtual void OnAccessibilityNotifications( | 282 virtual void OnAccessibilityNotifications( |
| 285 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 283 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 306 | 304 |
| 307 // The current reserved area in view coordinates where contents should not be | 305 // The current reserved area in view coordinates where contents should not be |
| 308 // rendered to draw the resize corner, sidebar mini tabs etc. | 306 // rendered to draw the resize corner, sidebar mini tabs etc. |
| 309 gfx::Rect reserved_rect_; | 307 gfx::Rect reserved_rect_; |
| 310 | 308 |
| 311 private: | 309 private: |
| 312 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 310 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 313 }; | 311 }; |
| 314 | 312 |
| 315 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 313 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |