| 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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CONTENT_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> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "content/common/content_export.h" |
| 17 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
| 21 #include "ui/base/ime/text_input_type.h" | 22 #include "ui/base/ime/text_input_type.h" |
| 22 #include "ui/base/range/range.h" | 23 #include "ui/base/range/range.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| 24 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
| 25 #include "ui/gfx/surface/transport_dib.h" | 26 #include "ui/gfx/surface/transport_dib.h" |
| 26 | 27 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 | 58 |
| 58 // RenderWidgetHostView is an interface implemented by an object that acts as | 59 // RenderWidgetHostView is an interface implemented by an object that acts as |
| 59 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its | 60 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its |
| 60 // associated RenderProcessHost own the "Model" in this case which is the | 61 // associated RenderProcessHost own the "Model" in this case which is the |
| 61 // child renderer process. The View is responsible for receiving events from | 62 // child renderer process. The View is responsible for receiving events from |
| 62 // the surrounding environment and passing them to the RenderWidgetHost, and | 63 // the surrounding environment and passing them to the RenderWidgetHost, and |
| 63 // for actually displaying the content of the RenderWidgetHost when it | 64 // for actually displaying the content of the RenderWidgetHost when it |
| 64 // changes. | 65 // changes. |
| 65 class RenderWidgetHostView { | 66 class RenderWidgetHostView { |
| 66 public: | 67 public: |
| 67 virtual ~RenderWidgetHostView(); | 68 CONTENT_EXPORT virtual ~RenderWidgetHostView(); |
| 68 | 69 |
| 69 // Platform-specific creator. Use this to construct new RenderWidgetHostViews | 70 // Platform-specific creator. Use this to construct new RenderWidgetHostViews |
| 70 // rather than using RenderWidgetHostViewWin & friends. | 71 // rather than using RenderWidgetHostViewWin & friends. |
| 71 // | 72 // |
| 72 // This function must NOT size it, because the RenderView in the renderer | 73 // This function must NOT size it, because the RenderView in the renderer |
| 73 // wounldn't have been created yet. The widget would set its "waiting for | 74 // wounldn't have been created yet. The widget would set its "waiting for |
| 74 // resize ack" flag, and the ack would never come becasue no RenderView | 75 // resize ack" flag, and the ack would never come becasue no RenderView |
| 75 // received it. | 76 // received it. |
| 76 // | 77 // |
| 77 // The RenderWidgetHost must already be created (because we can't know if it's | 78 // The RenderWidgetHost must already be created (because we can't know if it's |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 virtual void SetScrollOffsetPinning( | 309 virtual void SetScrollOffsetPinning( |
| 309 bool is_pinned_to_left, bool is_pinned_to_right) = 0; | 310 bool is_pinned_to_left, bool is_pinned_to_right) = 0; |
| 310 | 311 |
| 311 void set_popup_type(WebKit::WebPopupType popup_type) { | 312 void set_popup_type(WebKit::WebPopupType popup_type) { |
| 312 popup_type_ = popup_type; | 313 popup_type_ = popup_type; |
| 313 } | 314 } |
| 314 WebKit::WebPopupType popup_type() const { return popup_type_; } | 315 WebKit::WebPopupType popup_type() const { return popup_type_; } |
| 315 | 316 |
| 316 // Subclasses should override this method to do what is appropriate to set | 317 // Subclasses should override this method to do what is appropriate to set |
| 317 // the custom background for their platform. | 318 // the custom background for their platform. |
| 318 virtual void SetBackground(const SkBitmap& background); | 319 CONTENT_EXPORT virtual void SetBackground(const SkBitmap& background); |
| 319 const SkBitmap& background() const { return background_; } | 320 const SkBitmap& background() const { return background_; } |
| 320 | 321 |
| 321 virtual void OnAccessibilityNotifications( | 322 virtual void OnAccessibilityNotifications( |
| 322 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 323 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| 323 } | 324 } |
| 324 | 325 |
| 325 gfx::Rect reserved_contents_rect() const { | 326 gfx::Rect reserved_contents_rect() const { |
| 326 return reserved_rect_; | 327 return reserved_rect_; |
| 327 } | 328 } |
| 328 void set_reserved_contents_rect(const gfx::Rect& reserved_rect) { | 329 void set_reserved_contents_rect(const gfx::Rect& reserved_rect) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 343 | 344 |
| 344 // The current reserved area in view coordinates where contents should not be | 345 // The current reserved area in view coordinates where contents should not be |
| 345 // rendered to draw the resize corner, sidebar mini tabs etc. | 346 // rendered to draw the resize corner, sidebar mini tabs etc. |
| 346 gfx::Rect reserved_rect_; | 347 gfx::Rect reserved_rect_; |
| 347 | 348 |
| 348 private: | 349 private: |
| 349 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 350 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 350 }; | 351 }; |
| 351 | 352 |
| 352 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 353 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |