Chromium Code Reviews| 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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 425 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| 426 // are still generated. However, the position they report is the last known | 426 // are still generated. However, the position they report is the last known |
| 427 // mouse position just as mouse lock was entered; the movement they report | 427 // mouse position just as mouse lock was entered; the movement they report |
| 428 // indicates what the change in position of the mouse would be had it not been | 428 // indicates what the change in position of the mouse would be had it not been |
| 429 // locked. | 429 // locked. |
| 430 bool mouse_locked_; | 430 bool mouse_locked_; |
| 431 | 431 |
| 432 // Whether we are showing a context menu. | 432 // Whether we are showing a context menu. |
| 433 bool showing_context_menu_; | 433 bool showing_context_menu_; |
| 434 | 434 |
| 435 // TODO(ekaramad): In aura, text selection tracking for IME is done through the | |
| 436 // TextInputManager. We still need the following variables for other platforms. | |
| 437 // Remove them when tracking is done by TextInputManager on all platforms | |
| 438 // (https://crbug.com/578168). | |
| 439 #if !defined(USE_AURA) | |
| 435 // A buffer containing the text inside and around the current selection range. | 440 // A buffer containing the text inside and around the current selection range. |
| 436 base::string16 selection_text_; | 441 base::string16 selection_text_; |
| 437 | 442 |
| 438 // The offset of the text stored in |selection_text_| relative to the start of | 443 // The offset of the text stored in |selection_text_| relative to the start of |
| 439 // the web page. | 444 // the web page. |
| 440 size_t selection_text_offset_; | 445 size_t selection_text_offset_; |
| 441 | 446 |
| 442 // The current selection range relative to the start of the web page. | 447 // The current selection range relative to the start of the web page. |
| 443 gfx::Range selection_range_; | 448 gfx::Range selection_range_; |
| 449 #endif | |
| 444 | 450 |
| 445 // The scale factor of the display the renderer is currently on. | 451 // The scale factor of the display the renderer is currently on. |
| 446 float current_device_scale_factor_; | 452 float current_device_scale_factor_; |
| 447 | 453 |
| 448 // The orientation of the display the renderer is currently on. | 454 // The orientation of the display the renderer is currently on. |
| 449 display::Display::Rotation current_display_rotation_; | 455 display::Display::Rotation current_display_rotation_; |
| 450 | 456 |
| 451 // Whether pinch-to-zoom should be enabled and pinch events forwarded to the | 457 // Whether pinch-to-zoom should be enabled and pinch events forwarded to the |
| 452 // renderer. | 458 // renderer. |
| 453 bool pinch_zoom_enabled_; | 459 bool pinch_zoom_enabled_; |
| 454 | 460 |
| 455 // A reference to current TextInputManager instance this RWHV is registered | 461 // A reference to current TextInputManager instance this RWHV is registered |
| 456 // with. This is initially nullptr until the first time the view calls | 462 // with. This is initially nullptr until the first time the view calls |
| 457 // GetTextInputManager(). It also becomes nullptr when TextInputManager is | 463 // GetTextInputManager(). It also becomes nullptr when TextInputManager is |
| 458 // destroyed before the RWHV is destroyed. | 464 // destroyed before the RWHV is destroyed. |
| 459 TextInputManager* text_input_manager_; | 465 TextInputManager* text_input_manager_; |
| 460 | 466 |
| 461 private: | 467 private: |
| 462 void FlushInput(); | 468 void FlushInput(); |
| 463 | 469 |
| 470 // The non-const implementation of RenderWidgetHostView::GetSelectedText(). | |
|
kenrb
2016/07/12 19:15:25
Why is this needed? There is only one caller, whic
EhsanK
2016/07/12 19:33:48
The idea was to remove |selection_text_|, |selecti
kenrb
2016/07/12 20:15:17
Yeah, this isn't good. Basically it is trying to c
EhsanK
2016/07/18 15:21:29
So basically we ended up removing const from this
| |
| 471 base::string16 GetSelectedTextFromTextInputManager(); | |
| 472 | |
| 464 gfx::Rect current_display_area_; | 473 gfx::Rect current_display_area_; |
| 465 | 474 |
| 466 uint32_t renderer_frame_number_; | 475 uint32_t renderer_frame_number_; |
| 467 | 476 |
| 468 base::OneShotTimer flush_input_timer_; | 477 base::OneShotTimer flush_input_timer_; |
| 469 | 478 |
| 470 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 479 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| 471 | 480 |
| 472 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 481 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 473 | 482 |
| 474 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 483 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 475 }; | 484 }; |
| 476 | 485 |
| 477 } // namespace content | 486 } // namespace content |
| 478 | 487 |
| 479 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 488 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |