| 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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "third_party/WebKit/public/web/WebIconURL.h" | 53 #include "third_party/WebKit/public/web/WebIconURL.h" |
| 54 #include "third_party/WebKit/public/web/WebNavigationType.h" | 54 #include "third_party/WebKit/public/web/WebNavigationType.h" |
| 55 #include "third_party/WebKit/public/web/WebNode.h" | 55 #include "third_party/WebKit/public/web/WebNode.h" |
| 56 #include "third_party/WebKit/public/web/WebViewClient.h" | 56 #include "third_party/WebKit/public/web/WebViewClient.h" |
| 57 #include "ui/base/window_open_disposition.h" | 57 #include "ui/base/window_open_disposition.h" |
| 58 #include "ui/gfx/geometry/rect.h" | 58 #include "ui/gfx/geometry/rect.h" |
| 59 #include "ui/gfx/geometry/rect_f.h" | 59 #include "ui/gfx/geometry/rect_f.h" |
| 60 #include "ui/surface/transport_dib.h" | 60 #include "ui/surface/transport_dib.h" |
| 61 | 61 |
| 62 #if defined(OS_ANDROID) | 62 #if defined(OS_ANDROID) |
| 63 #include "content/renderer/android/content_detector.h" | |
| 64 #include "content/renderer/android/renderer_date_time_picker.h" | 63 #include "content/renderer/android/renderer_date_time_picker.h" |
| 65 #endif | 64 #endif |
| 66 | 65 |
| 67 #if defined(COMPILER_MSVC) | 66 #if defined(COMPILER_MSVC) |
| 68 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the | 67 // RenderViewImpl is a diamond-shaped hierarchy, with WebWidgetClient at the |
| 69 // root. VS warns when we inherit the WebWidgetClient method implementations | 68 // root. VS warns when we inherit the WebWidgetClient method implementations |
| 70 // from RenderWidget. It's safe to ignore that warning. | 69 // from RenderWidget. It's safe to ignore that warning. |
| 71 #pragma warning(disable: 4250) | 70 #pragma warning(disable: 4250) |
| 72 #endif | 71 #endif |
| 73 | 72 |
| 74 namespace blink { | 73 namespace blink { |
| 75 class WebDataSource; | 74 class WebDataSource; |
| 76 class WebDateTimeChooserCompletion; | 75 class WebDateTimeChooserCompletion; |
| 77 class WebGestureEvent; | 76 class WebGestureEvent; |
| 78 class WebIconURL; | 77 class WebIconURL; |
| 79 class WebMouseEvent; | 78 class WebMouseEvent; |
| 80 class WebSpeechRecognizer; | 79 class WebSpeechRecognizer; |
| 81 class WebStorageNamespace; | 80 class WebStorageNamespace; |
| 82 class WebURLRequest; | 81 class WebURLRequest; |
| 83 struct WebActiveWheelFlingParameters; | 82 struct WebActiveWheelFlingParameters; |
| 84 struct WebDateTimeChooserParams; | 83 struct WebDateTimeChooserParams; |
| 85 struct WebMediaPlayerAction; | 84 struct WebMediaPlayerAction; |
| 86 struct WebPluginAction; | 85 struct WebPluginAction; |
| 87 struct WebPoint; | 86 struct WebPoint; |
| 88 struct WebWindowFeatures; | 87 struct WebWindowFeatures; |
| 89 | |
| 90 #if defined(OS_ANDROID) | |
| 91 class WebHitTestResult; | |
| 92 #endif | |
| 93 } // namespace blink | 88 } // namespace blink |
| 94 | 89 |
| 95 namespace gfx { | 90 namespace gfx { |
| 96 class ICCProfile; | 91 class ICCProfile; |
| 97 } | 92 } |
| 98 | 93 |
| 99 namespace content { | 94 namespace content { |
| 100 | 95 |
| 101 class RendererDateTimePicker; | 96 class RendererDateTimePicker; |
| 102 class RenderViewImplTest; | 97 class RenderViewImplTest; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 void pageScaleFactorChanged() override; | 332 void pageScaleFactorChanged() override; |
| 338 virtual double zoomLevelToZoomFactor(double zoom_level) const; | 333 virtual double zoomLevelToZoomFactor(double zoom_level) const; |
| 339 virtual double zoomFactorToZoomLevel(double factor) const; | 334 virtual double zoomFactorToZoomLevel(double factor) const; |
| 340 void draggableRegionsChanged() override; | 335 void draggableRegionsChanged() override; |
| 341 void pageImportanceSignalsChanged() override; | 336 void pageImportanceSignalsChanged() override; |
| 342 void didAutoResize(const blink::WebSize& newSize) override; | 337 void didAutoResize(const blink::WebSize& newSize) override; |
| 343 blink::WebRect rootWindowRect() override; | 338 blink::WebRect rootWindowRect() override; |
| 344 void didFocus() override; | 339 void didFocus() override; |
| 345 | 340 |
| 346 #if defined(OS_ANDROID) | 341 #if defined(OS_ANDROID) |
| 347 void scheduleContentIntent(const blink::WebURL& intent, | |
| 348 bool is_main_frame) override; | |
| 349 void cancelScheduledContentIntents() override; | |
| 350 blink::WebURL detectContentIntentAt( | |
| 351 const blink::WebHitTestResult& touch_hit) override; | |
| 352 | |
| 353 // Only used on Android since all other platforms implement | 342 // Only used on Android since all other platforms implement |
| 354 // date and time input fields using MULTIPLE_FIELDS_UI | 343 // date and time input fields using MULTIPLE_FIELDS_UI |
| 355 bool openDateTimeChooser(const blink::WebDateTimeChooserParams&, | 344 bool openDateTimeChooser(const blink::WebDateTimeChooserParams&, |
| 356 blink::WebDateTimeChooserCompletion*) override; | 345 blink::WebDateTimeChooserCompletion*) override; |
| 357 virtual void didScrollWithKeyboard(const blink::WebSize& delta); | 346 virtual void didScrollWithKeyboard(const blink::WebSize& delta); |
| 358 #endif | 347 #endif |
| 359 | 348 |
| 360 // RenderView implementation ------------------------------------------------- | 349 // RenderView implementation ------------------------------------------------- |
| 361 | 350 |
| 362 bool Send(IPC::Message* message) override; | 351 bool Send(IPC::Message* message) override; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 void OnPageWasShown(); | 566 void OnPageWasShown(); |
| 578 | 567 |
| 579 // Adding a new message handler? Please add it in alphabetical order above | 568 // Adding a new message handler? Please add it in alphabetical order above |
| 580 // and put it in the same position in the .cc file. | 569 // and put it in the same position in the .cc file. |
| 581 | 570 |
| 582 // Misc private functions ---------------------------------------------------- | 571 // Misc private functions ---------------------------------------------------- |
| 583 // Check whether the preferred size has changed. | 572 // Check whether the preferred size has changed. |
| 584 void CheckPreferredSize(); | 573 void CheckPreferredSize(); |
| 585 | 574 |
| 586 #if defined(OS_ANDROID) | 575 #if defined(OS_ANDROID) |
| 587 // Launch an Android content intent with the given URL. | |
| 588 void LaunchAndroidContentIntent(const GURL& intent_url, | |
| 589 size_t request_id, | |
| 590 bool is_main_frame); | |
| 591 // Make the video capture devices (e.g. webcam) stop/resume delivering video | 576 // Make the video capture devices (e.g. webcam) stop/resume delivering video |
| 592 // frames to their clients, depending on flag |suspend|. This is called in | 577 // frames to their clients, depending on flag |suspend|. This is called in |
| 593 // response to a RenderView PageHidden/Shown(). | 578 // response to a RenderView PageHidden/Shown(). |
| 594 void SuspendVideoCaptureDevices(bool suspend); | 579 void SuspendVideoCaptureDevices(bool suspend); |
| 595 #endif | 580 #endif |
| 596 | 581 |
| 597 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) | 582 #if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) |
| 598 void UpdateFontRenderingFromRendererPrefs(); | 583 void UpdateFontRenderingFromRendererPrefs(); |
| 599 #else | 584 #else |
| 600 void UpdateFontRenderingFromRendererPrefs() {} | 585 void UpdateFontRenderingFromRendererPrefs() {} |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 // along with the RenderView automatically. This is why we just store | 778 // along with the RenderView automatically. This is why we just store |
| 794 // weak references. | 779 // weak references. |
| 795 | 780 |
| 796 // The speech recognition dispatcher attached to this view, lazily | 781 // The speech recognition dispatcher attached to this view, lazily |
| 797 // initialized. | 782 // initialized. |
| 798 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; | 783 SpeechRecognitionDispatcher* speech_recognition_dispatcher_; |
| 799 | 784 |
| 800 #if defined(OS_ANDROID) | 785 #if defined(OS_ANDROID) |
| 801 // Android Specific --------------------------------------------------------- | 786 // Android Specific --------------------------------------------------------- |
| 802 | 787 |
| 803 // Expected id of the next content intent launched. Used to prevent scheduled | |
| 804 // intents to be launched if aborted. | |
| 805 size_t expected_content_intent_id_; | |
| 806 | |
| 807 // List of click-based content detectors. | |
| 808 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; | |
| 809 | |
| 810 // A date/time picker object for date and time related input elements. | 788 // A date/time picker object for date and time related input elements. |
| 811 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; | 789 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; |
| 812 | 790 |
| 813 // Whether this was a renderer-created or browser-created RenderView. | 791 // Whether this was a renderer-created or browser-created RenderView. |
| 814 bool was_created_by_renderer_; | 792 bool was_created_by_renderer_; |
| 815 #endif | 793 #endif |
| 816 | 794 |
| 817 // Misc ---------------------------------------------------------------------- | 795 // Misc ---------------------------------------------------------------------- |
| 818 | 796 |
| 819 // The current directory enumeration callback | 797 // The current directory enumeration callback |
| (...skipping 26 matching lines...) Expand all Loading... |
| 846 // --------------------------------------------------------------------------- | 824 // --------------------------------------------------------------------------- |
| 847 | 825 |
| 848 base::WeakPtrFactory<RenderViewImpl> weak_ptr_factory_; | 826 base::WeakPtrFactory<RenderViewImpl> weak_ptr_factory_; |
| 849 | 827 |
| 850 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 828 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
| 851 }; | 829 }; |
| 852 | 830 |
| 853 } // namespace content | 831 } // namespace content |
| 854 | 832 |
| 855 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 833 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
| OLD | NEW |