| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 CONTENT_EXPORT virtual void SelectionChanged(const string16& text, | 194 CONTENT_EXPORT virtual void SelectionChanged(const string16& text, |
| 195 size_t offset, | 195 size_t offset, |
| 196 const ui::Range& range); | 196 const ui::Range& range); |
| 197 | 197 |
| 198 // Notifies the View that the renderer selection bounds has changed. | 198 // Notifies the View that the renderer selection bounds has changed. |
| 199 // |start_rect| and |end_rect| are the bounds end of the selection in the | 199 // |start_rect| and |end_rect| are the bounds end of the selection in the |
| 200 // coordinate system of the render view. | 200 // coordinate system of the render view. |
| 201 virtual void SelectionBoundsChanged(const gfx::Rect& start_rect, | 201 virtual void SelectionBoundsChanged(const gfx::Rect& start_rect, |
| 202 const gfx::Rect& end_rect) {} | 202 const gfx::Rect& end_rect) {} |
| 203 | 203 |
| 204 // Tells the View whether the context menu is showing. This is used on Linux | 204 // Tells the View whether the context menu is showing. |
| 205 // to suppress updates to webkit focus for the duration of the show. | 205 virtual void ShowingContextMenu(bool showing); |
| 206 virtual void ShowingContextMenu(bool showing) {} | |
| 207 | 206 |
| 208 // Allocate a backing store for this view | 207 // Allocate a backing store for this view. |
| 209 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; | 208 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; |
| 210 | 209 |
| 211 // Called when accelerated compositing state changes. | 210 // Called when accelerated compositing state changes. |
| 212 virtual void OnAcceleratedCompositingStateChange() = 0; | 211 virtual void OnAcceleratedCompositingStateChange() = 0; |
| 213 // |params.window| and |params.surface_id| indicate which accelerated | 212 // |params.window| and |params.surface_id| indicate which accelerated |
| 214 // surface's buffers swapped. |params.renderer_id| and |params.route_id| | 213 // surface's buffers swapped. |params.renderer_id| and |params.route_id| |
| 215 // are used to formulate a reply to the GPU process to prevent it from getting | 214 // are used to formulate a reply to the GPU process to prevent it from getting |
| 216 // too far ahead. They may all be zero, in which case no flow control is | 215 // too far ahead. They may all be zero, in which case no flow control is |
| 217 // enforced; this case is currently used for accelerated plugins. | 216 // enforced; this case is currently used for accelerated plugins. |
| 218 virtual void AcceleratedSurfaceBuffersSwapped( | 217 virtual void AcceleratedSurfaceBuffersSwapped( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 const SkBitmap& background() const { return background_; } | 338 const SkBitmap& background() const { return background_; } |
| 340 | 339 |
| 341 virtual void OnAccessibilityNotifications( | 340 virtual void OnAccessibilityNotifications( |
| 342 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 341 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| 343 } | 342 } |
| 344 | 343 |
| 345 BrowserAccessibilityManager* GetBrowserAccessibilityManager() const; | 344 BrowserAccessibilityManager* GetBrowserAccessibilityManager() const; |
| 346 void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager); | 345 void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager); |
| 347 | 346 |
| 348 bool mouse_locked() const { return mouse_locked_; } | 347 bool mouse_locked() const { return mouse_locked_; } |
| 348 bool showing_context_menu() const { return showing_context_menu_; } |
| 349 | 349 |
| 350 protected: | 350 protected: |
| 351 // Interface class only, do not construct. | 351 // Interface class only, do not construct. |
| 352 CONTENT_EXPORT RenderWidgetHostView(); | 352 CONTENT_EXPORT RenderWidgetHostView(); |
| 353 | 353 |
| 354 // Whether this view is a popup and what kind of popup it is (select, | 354 // Whether this view is a popup and what kind of popup it is (select, |
| 355 // autofill...). | 355 // autofill...). |
| 356 WebKit::WebPopupType popup_type_; | 356 WebKit::WebPopupType popup_type_; |
| 357 | 357 |
| 358 // A custom background to paint behind the web content. This will be tiled | 358 // A custom background to paint behind the web content. This will be tiled |
| 359 // horizontally. Can be null, in which case we fall back to painting white. | 359 // horizontally. Can be null, in which case we fall back to painting white. |
| 360 SkBitmap background_; | 360 SkBitmap background_; |
| 361 | 361 |
| 362 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 362 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| 363 // are still generated. However, the position they report is the last known | 363 // are still generated. However, the position they report is the last known |
| 364 // mouse position just as mouse lock was entered; the movement they report | 364 // mouse position just as mouse lock was entered; the movement they report |
| 365 // indicates what the change in position of the mouse would be had it not been | 365 // indicates what the change in position of the mouse would be had it not been |
| 366 // locked. | 366 // locked. |
| 367 bool mouse_locked_; | 367 bool mouse_locked_; |
| 368 | 368 |
| 369 // Whether we are showing a context menu. |
| 370 bool showing_context_menu_; |
| 371 |
| 369 // A buffer containing the text inside and around the current selection range. | 372 // A buffer containing the text inside and around the current selection range. |
| 370 string16 selection_text_; | 373 string16 selection_text_; |
| 371 | 374 |
| 372 // The offset of the text stored in |selection_text_| relative to the start of | 375 // The offset of the text stored in |selection_text_| relative to the start of |
| 373 // the web page. | 376 // the web page. |
| 374 size_t selection_text_offset_; | 377 size_t selection_text_offset_; |
| 375 | 378 |
| 376 // The current selection range relative to the start of the web page. | 379 // The current selection range relative to the start of the web page. |
| 377 ui::Range selection_range_; | 380 ui::Range selection_range_; |
| 378 | 381 |
| 379 private: | 382 private: |
| 380 // Manager of the tree representation of the WebKit render tree. | 383 // Manager of the tree representation of the WebKit render tree. |
| 381 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; | 384 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; |
| 382 | 385 |
| 383 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 386 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 384 }; | 387 }; |
| 385 | 388 |
| 386 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 389 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |