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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 // the list of registered views, i.e., TextInputManager is no longer tracking | 134 // the list of registered views, i.e., TextInputManager is no longer tracking |
| 135 // TextInputState from this view. The RWHV should reset |text_input_manager_| | 135 // TextInputState from this view. The RWHV should reset |text_input_manager_| |
| 136 // to nullptr. | 136 // to nullptr. |
| 137 void DidUnregisterFromTextInputManager(TextInputManager* text_input_manager); | 137 void DidUnregisterFromTextInputManager(TextInputManager* text_input_manager); |
| 138 | 138 |
| 139 base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr(); | 139 base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr(); |
| 140 | 140 |
| 141 //---------------------------------------------------------------------------- | 141 //---------------------------------------------------------------------------- |
| 142 // The following methods can be overridden by derived classes. | 142 // The following methods can be overridden by derived classes. |
| 143 | 143 |
| 144 // Notifies the View that the renderer selection bounds has changed. | |
| 145 // |start_rect| and |end_rect| are the bounds end of the selection in the | |
| 146 // coordinate system of the render widget. |start_direction| and | |
| 147 // |end_direction| indicates the direction at which the selection was made on | |
| 148 // touch devices. | |
| 149 virtual void SelectionBoundsChanged( | |
| 150 const ViewHostMsg_SelectionBounds_Params& params); | |
| 151 | |
| 144 // Notifies the View that the renderer text selection has changed. | 152 // Notifies the View that the renderer text selection has changed. |
| 145 virtual void SelectionChanged(const base::string16& text, | 153 virtual void SelectionChanged(const base::string16& text, |
| 146 size_t offset, | 154 size_t offset, |
| 147 const gfx::Range& range); | 155 const gfx::Range& range); |
| 148 | 156 |
| 149 // The requested size of the renderer. May differ from GetViewBounds().size() | 157 // The requested size of the renderer. May differ from GetViewBounds().size() |
| 150 // when the view requires additional throttling. | 158 // when the view requires additional throttling. |
| 151 virtual gfx::Size GetRequestedRendererSize() const; | 159 virtual gfx::Size GetRequestedRendererSize() const; |
| 152 | 160 |
| 153 // The size of the view's backing surface in non-DPI-adjusted pixels. | 161 // The size of the view's backing surface in non-DPI-adjusted pixels. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 | 261 |
| 254 // Updates the state of the input method attached to the view. | 262 // Updates the state of the input method attached to the view. |
| 255 // TODO(ekaramad): This method will not stay virtual. It will be moved up top | 263 // TODO(ekaramad): This method will not stay virtual. It will be moved up top |
| 256 // with the other non-virtual methods after TextInputState tracking is fixed | 264 // with the other non-virtual methods after TextInputState tracking is fixed |
| 257 // on all platforms (https://crbug.com/578168). | 265 // on all platforms (https://crbug.com/578168). |
| 258 virtual void TextInputStateChanged(const TextInputState& text_input_state); | 266 virtual void TextInputStateChanged(const TextInputState& text_input_state); |
| 259 | 267 |
| 260 // Cancel the ongoing composition of the input method attached to the view. | 268 // Cancel the ongoing composition of the input method attached to the view. |
| 261 // TODO(ekaramad): This method will not stay virtual. It will be moved up top | 269 // TODO(ekaramad): This method will not stay virtual. It will be moved up top |
| 262 // with the other non-virtual methods after IME is fixed on all platforms. | 270 // with the other non-virtual methods after IME is fixed on all platforms. |
| 263 // (https://crbug.com/578168). | 271 // (https://crbug.com/578168). |
|
Charlie Reis
2016/06/29 20:18:37
I'm just trying to follow the pattern-- does this
EhsanK
2016/06/30 00:24:45
Yes. I actually moved the method down here with th
Charlie Reis
2016/06/30 20:27:21
Feel free to create a separate section with the TO
EhsanK
2016/06/30 21:01:14
Acknowledged.
| |
| 264 virtual void ImeCancelComposition(); | 272 virtual void ImeCancelComposition(); |
| 265 | 273 |
| 266 //---------------------------------------------------------------------------- | 274 //---------------------------------------------------------------------------- |
| 267 // The following static methods are implemented by each platform. | 275 // The following static methods are implemented by each platform. |
| 268 | 276 |
| 269 static void GetDefaultScreenInfo(blink::WebScreenInfo* results); | 277 static void GetDefaultScreenInfo(blink::WebScreenInfo* results); |
| 270 | 278 |
| 271 //---------------------------------------------------------------------------- | 279 //---------------------------------------------------------------------------- |
| 272 // The following pure virtual methods are implemented by derived classes. | 280 // The following pure virtual methods are implemented by derived classes. |
| 273 | 281 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 292 virtual void RenderProcessGone(base::TerminationStatus status, | 300 virtual void RenderProcessGone(base::TerminationStatus status, |
| 293 int error_code) = 0; | 301 int error_code) = 0; |
| 294 | 302 |
| 295 // Tells the View to destroy itself. | 303 // Tells the View to destroy itself. |
| 296 virtual void Destroy() = 0; | 304 virtual void Destroy() = 0; |
| 297 | 305 |
| 298 // Tells the View that the tooltip text for the current mouse position over | 306 // Tells the View that the tooltip text for the current mouse position over |
| 299 // the page has changed. | 307 // the page has changed. |
| 300 virtual void SetTooltipText(const base::string16& tooltip_text) = 0; | 308 virtual void SetTooltipText(const base::string16& tooltip_text) = 0; |
| 301 | 309 |
| 302 // Notifies the View that the renderer selection bounds has changed. | |
| 303 // |start_rect| and |end_rect| are the bounds end of the selection in the | |
| 304 // coordinate system of the render view. |start_direction| and |end_direction| | |
| 305 // indicates the direction at which the selection was made on touch devices. | |
| 306 virtual void SelectionBoundsChanged( | |
| 307 const ViewHostMsg_SelectionBounds_Params& params) = 0; | |
| 308 | |
| 309 // Copies the contents of the compositing surface, providing a new SkBitmap | 310 // Copies the contents of the compositing surface, providing a new SkBitmap |
| 310 // result via an asynchronously-run |callback|. |src_subrect| is specified in | 311 // result via an asynchronously-run |callback|. |src_subrect| is specified in |
| 311 // layer space coordinates for the current platform (e.g., DIP for Aura/Mac, | 312 // layer space coordinates for the current platform (e.g., DIP for Aura/Mac, |
| 312 // physical for Android), and is the region to be copied from this view. When | 313 // physical for Android), and is the region to be copied from this view. When |
| 313 // |src_subrect| is empty then the whole surface will be copied. The copy is | 314 // |src_subrect| is empty then the whole surface will be copied. The copy is |
| 314 // then scaled to a SkBitmap of size |dst_size|. If |dst_size| is empty then | 315 // then scaled to a SkBitmap of size |dst_size|. If |dst_size| is empty then |
| 315 // output will be unscaled. |callback| is run with true on success, | 316 // output will be unscaled. |callback| is run with true on success, |
| 316 // false otherwise. A smaller region than |src_subrect| may be copied | 317 // false otherwise. A smaller region than |src_subrect| may be copied |
| 317 // if the underlying surface is smaller than |src_subrect|. | 318 // if the underlying surface is smaller than |src_subrect|. |
| 318 virtual void CopyFromCompositingSurface( | 319 virtual void CopyFromCompositingSurface( |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 469 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| 469 | 470 |
| 470 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 471 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 471 | 472 |
| 472 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 473 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 473 }; | 474 }; |
| 474 | 475 |
| 475 } // namespace content | 476 } // namespace content |
| 476 | 477 |
| 477 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 478 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |