| 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/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
| 18 #include "base/callback_forward.h" | 18 #include "base/callback_forward.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 21 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
| 24 #include "ui/base/ime/text_input_type.h" | 24 #include "ui/base/ime/text_input_type.h" |
| 25 #include "ui/base/range/range.h" | 25 #include "ui/base/range/range.h" |
| 26 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 27 #include "ui/gfx/rect.h" | |
| 28 #include "ui/gfx/surface/transport_dib.h" | 27 #include "ui/gfx/surface/transport_dib.h" |
| 29 | 28 |
| 30 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 29 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 31 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 30 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
| 32 | 31 |
| 33 class BackingStore; | 32 class BackingStore; |
| 34 class BrowserAccessibilityManager; | 33 class BrowserAccessibilityManager; |
| 35 class RenderWidgetHost; | 34 class RenderWidgetHost; |
| 36 class WebCursor; | 35 class WebCursor; |
| 37 struct NativeWebKeyboardEvent; | 36 struct NativeWebKeyboardEvent; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 CONTENT_EXPORT virtual void SetBackground(const SkBitmap& background); | 322 CONTENT_EXPORT virtual void SetBackground(const SkBitmap& background); |
| 324 const SkBitmap& background() const { return background_; } | 323 const SkBitmap& background() const { return background_; } |
| 325 | 324 |
| 326 virtual void OnAccessibilityNotifications( | 325 virtual void OnAccessibilityNotifications( |
| 327 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 326 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| 328 } | 327 } |
| 329 | 328 |
| 330 BrowserAccessibilityManager* GetBrowserAccessibilityManager() const; | 329 BrowserAccessibilityManager* GetBrowserAccessibilityManager() const; |
| 331 void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager); | 330 void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager); |
| 332 | 331 |
| 333 gfx::Rect reserved_contents_rect() const { | |
| 334 return reserved_rect_; | |
| 335 } | |
| 336 void set_reserved_contents_rect(const gfx::Rect& reserved_rect) { | |
| 337 reserved_rect_ = reserved_rect; | |
| 338 } | |
| 339 | |
| 340 bool mouse_locked() const { return mouse_locked_; } | 332 bool mouse_locked() const { return mouse_locked_; } |
| 341 | 333 |
| 342 protected: | 334 protected: |
| 343 // Interface class only, do not construct. | 335 // Interface class only, do not construct. |
| 344 CONTENT_EXPORT RenderWidgetHostView(); | 336 CONTENT_EXPORT RenderWidgetHostView(); |
| 345 | 337 |
| 346 // Whether this view is a popup and what kind of popup it is (select, | 338 // Whether this view is a popup and what kind of popup it is (select, |
| 347 // autofill...). | 339 // autofill...). |
| 348 WebKit::WebPopupType popup_type_; | 340 WebKit::WebPopupType popup_type_; |
| 349 | 341 |
| 350 // A custom background to paint behind the web content. This will be tiled | 342 // A custom background to paint behind the web content. This will be tiled |
| 351 // horizontally. Can be null, in which case we fall back to painting white. | 343 // horizontally. Can be null, in which case we fall back to painting white. |
| 352 SkBitmap background_; | 344 SkBitmap background_; |
| 353 | 345 |
| 354 // The current reserved area in view coordinates where contents should not be | |
| 355 // rendered to draw the resize corner, sidebar mini tabs etc. | |
| 356 gfx::Rect reserved_rect_; | |
| 357 | |
| 358 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 346 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| 359 // are still generated. However, the position they report is the last known | 347 // are still generated. However, the position they report is the last known |
| 360 // mouse position just as mouse lock was entered; the movement they report | 348 // mouse position just as mouse lock was entered; the movement they report |
| 361 // indicates what the change in position of the mouse would be had it not been | 349 // indicates what the change in position of the mouse would be had it not been |
| 362 // locked. | 350 // locked. |
| 363 bool mouse_locked_; | 351 bool mouse_locked_; |
| 364 | 352 |
| 365 // A buffer containing the text inside and around the current selection range. | 353 // A buffer containing the text inside and around the current selection range. |
| 366 string16 selection_text_; | 354 string16 selection_text_; |
| 367 | 355 |
| 368 // The offset of the text stored in |selection_text_| relative to the start of | 356 // The offset of the text stored in |selection_text_| relative to the start of |
| 369 // the web page. | 357 // the web page. |
| 370 size_t selection_text_offset_; | 358 size_t selection_text_offset_; |
| 371 | 359 |
| 372 // The current selection range relative to the start of the web page. | 360 // The current selection range relative to the start of the web page. |
| 373 ui::Range selection_range_; | 361 ui::Range selection_range_; |
| 374 | 362 |
| 375 private: | 363 private: |
| 376 // Manager of the tree representation of the WebKit render tree. | 364 // Manager of the tree representation of the WebKit render tree. |
| 377 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; | 365 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; |
| 378 | 366 |
| 379 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 367 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 380 }; | 368 }; |
| 381 | 369 |
| 382 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 370 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |