OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 void StartFinding(int request_id, | 205 void StartFinding(int request_id, |
206 const string16& search_string, | 206 const string16& search_string, |
207 bool forward, | 207 bool forward, |
208 bool match_case, | 208 bool match_case, |
209 bool find_next); | 209 bool find_next); |
210 | 210 |
211 // Cancel a pending find operation. If |clear_selection| is true, it will also | 211 // Cancel a pending find operation. If |clear_selection| is true, it will also |
212 // clear the selection on the focused frame. | 212 // clear the selection on the focused frame. |
213 void StopFinding(bool clear_selection); | 213 void StopFinding(bool clear_selection); |
214 | 214 |
| 215 // Get the most probable language of the text content in the tab. This sends |
| 216 // a message to the render view to get the content of the page as text. The |
| 217 // caller gets the language via the NotificationService by registering to the |
| 218 // NotificationType TAB_LANGUAGE_DETERMINED. |
| 219 void GetPageLanguage(); |
| 220 |
215 // Change the zoom level of a page. | 221 // Change the zoom level of a page. |
216 void Zoom(PageZoom::Function function); | 222 void Zoom(PageZoom::Function function); |
217 | 223 |
218 // Change the encoding of the page. | 224 // Change the encoding of the page. |
219 void SetPageEncoding(const std::string& encoding); | 225 void SetPageEncoding(const std::string& encoding); |
220 | 226 |
221 // Reset any override encoding on the page and change back to default. | 227 // Reset any override encoding on the page and change back to default. |
222 void ResetPageEncodingToDefault(); | 228 void ResetPageEncodingToDefault(); |
223 | 229 |
224 // Change the alternate error page URL. An empty GURL disables the use of | 230 // Change the alternate error page URL. An empty GURL disables the use of |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 virtual void ForwardEditCommandsForNextKeyEvent( | 416 virtual void ForwardEditCommandsForNextKeyEvent( |
411 const EditCommands& edit_commands); | 417 const EditCommands& edit_commands); |
412 virtual gfx::Rect GetRootWindowResizerRect() const; | 418 virtual gfx::Rect GetRootWindowResizerRect() const; |
413 | 419 |
414 // Creates a new RenderView with the given route id. | 420 // Creates a new RenderView with the given route id. |
415 void CreateNewWindow(int route_id); | 421 void CreateNewWindow(int route_id); |
416 | 422 |
417 // Creates a new RenderWidget with the given route id. | 423 // Creates a new RenderWidget with the given route id. |
418 void CreateNewWidget(int route_id, bool activatable); | 424 void CreateNewWidget(int route_id, bool activatable); |
419 | 425 |
420 // Sends the response to an extension api call. | 426 // Send the response to an extension api call. |
421 void SendExtensionResponse(int request_id, bool success, | 427 void SendExtensionResponse(int request_id, bool success, |
422 const std::string& response, | 428 const std::string& response, |
423 const std::string& error); | 429 const std::string& error); |
424 | 430 |
425 // Sends a response to an extension api call that it was blocked for lack of | 431 // Send a response to an extension api call that it was blocked for lack of |
426 // permission. | 432 // permission. |
427 void BlockExtensionRequest(int request_id); | 433 void BlockExtensionRequest(int request_id); |
428 | 434 |
429 // Notifies the renderer that its view type has changed. | 435 // Notify the renderer that its view type has changed. |
430 void ViewTypeChanged(ViewType::Type type); | 436 void ViewTypeChanged(ViewType::Type type); |
431 | 437 |
432 // Tells the renderer which browser window it is being attached to. | 438 // Tell renderer which browser window it is being attached to. |
433 void UpdateBrowserWindowId(int window_id); | 439 void UpdateBrowserWindowId(int window_id); |
434 | 440 |
435 // Tells the render view that a custom context action has been selected. | 441 // Tell render view that custom context action has been selected. |
436 void PerformCustomContextMenuAction(unsigned action); | 442 void PerformCustomContextMenuAction(unsigned action); |
437 | 443 |
438 protected: | 444 protected: |
439 // RenderWidgetHost protected overrides. | 445 // RenderWidgetHost protected overrides. |
440 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 446 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
441 bool* is_keyboard_shortcut); | 447 bool* is_keyboard_shortcut); |
442 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); | 448 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event); |
443 virtual void OnUserGesture(); | 449 virtual void OnUserGesture(); |
444 virtual void NotifyRendererUnresponsive(); | 450 virtual void NotifyRendererUnresponsive(); |
445 virtual void NotifyRendererResponsive(); | 451 virtual void NotifyRendererResponsive(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 const GURL& url); | 488 const GURL& url); |
483 void OnMsgDidFailProvisionalLoadWithError(bool main_frame, | 489 void OnMsgDidFailProvisionalLoadWithError(bool main_frame, |
484 int error_code, | 490 int error_code, |
485 const GURL& url, | 491 const GURL& url, |
486 bool showing_repost_interstitial); | 492 bool showing_repost_interstitial); |
487 void OnMsgFindReply(int request_id, | 493 void OnMsgFindReply(int request_id, |
488 int number_of_matches, | 494 int number_of_matches, |
489 const gfx::Rect& selection_rect, | 495 const gfx::Rect& selection_rect, |
490 int active_match_ordinal, | 496 int active_match_ordinal, |
491 bool final_update); | 497 bool final_update); |
| 498 void OnDeterminePageTextReply(const std::wstring& tab_text); |
492 void OnExecuteCodeFinished(int request_id, bool success); | 499 void OnExecuteCodeFinished(int request_id, bool success); |
493 void OnMsgUpdateFavIconURL(int32 page_id, const GURL& icon_url); | 500 void OnMsgUpdateFavIconURL(int32 page_id, const GURL& icon_url); |
494 void OnMsgDidDownloadFavIcon(int id, | 501 void OnMsgDidDownloadFavIcon(int id, |
495 const GURL& image_url, | 502 const GURL& image_url, |
496 bool errored, | 503 bool errored, |
497 const SkBitmap& image_data); | 504 const SkBitmap& image_data); |
498 void OnMsgContextMenu(const ContextMenuParams& params); | 505 void OnMsgContextMenu(const ContextMenuParams& params); |
499 void OnMsgOpenURL(const GURL& url, const GURL& referrer, | 506 void OnMsgOpenURL(const GURL& url, const GURL& referrer, |
500 WindowOpenDisposition disposition); | 507 WindowOpenDisposition disposition); |
501 void OnMsgDidContentsPreferredSizeChange(const gfx::Size& new_size); | 508 void OnMsgDidContentsPreferredSizeChange(const gfx::Size& new_size); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 const string16& text, | 586 const string16& text, |
580 int notification_id); | 587 int notification_id); |
581 void OnCancelDesktopNotification(int notification_id); | 588 void OnCancelDesktopNotification(int notification_id); |
582 void OnRequestNotificationPermission(const GURL& origin, int callback_id); | 589 void OnRequestNotificationPermission(const GURL& origin, int callback_id); |
583 | 590 |
584 void OnExtensionRequest(const std::string& name, const ListValue& args, | 591 void OnExtensionRequest(const std::string& name, const ListValue& args, |
585 int request_id, bool has_callback); | 592 int request_id, bool has_callback); |
586 void OnExtensionPostMessage(int port_id, const std::string& message); | 593 void OnExtensionPostMessage(int port_id, const std::string& message); |
587 void OnAccessibilityFocusChange(int acc_obj_id); | 594 void OnAccessibilityFocusChange(int acc_obj_id); |
588 void OnCSSInserted(); | 595 void OnCSSInserted(); |
589 void OnPageContents(const GURL& url, | |
590 int32 page_id, | |
591 const std::wstring& contents); | |
592 | 596 |
593 private: | 597 private: |
594 friend class TestRenderViewHost; | 598 friend class TestRenderViewHost; |
595 | 599 |
596 void UpdateBackForwardListCount(); | 600 void UpdateBackForwardListCount(); |
597 | 601 |
598 // NotificationObserver implementation. | 602 // NotificationObserver implementation. |
599 void Observe(NotificationType type, | 603 void Observe(NotificationType type, |
600 const NotificationSource& source, | 604 const NotificationSource& source, |
601 const NotificationDetails& details); | 605 const NotificationDetails& details); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 | 664 |
661 // True if the render view can be shut down suddenly. | 665 // True if the render view can be shut down suddenly. |
662 bool sudden_termination_allowed_; | 666 bool sudden_termination_allowed_; |
663 | 667 |
664 NotificationRegistrar registrar_; | 668 NotificationRegistrar registrar_; |
665 | 669 |
666 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 670 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
667 }; | 671 }; |
668 | 672 |
669 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 673 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
OLD | NEW |