| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ | 5 #ifndef CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ |
| 6 #define CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ | 6 #define CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "content/public/renderer/render_frame_observer.h" | 10 #include "content/public/renderer/render_frame_observer.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 private: | 33 private: |
| 34 enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; | 34 enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; |
| 35 | 35 |
| 36 // RenderFrameObserver implementation. | 36 // RenderFrameObserver implementation. |
| 37 bool OnMessageReceived(const IPC::Message& message) override; | 37 bool OnMessageReceived(const IPC::Message& message) override; |
| 38 void DidFinishDocumentLoad() override; | 38 void DidFinishDocumentLoad() override; |
| 39 void DidStartProvisionalLoad() override; | 39 void DidStartProvisionalLoad() override; |
| 40 void DidFinishLoad() override; | 40 void DidFinishLoad() override; |
| 41 void DidCommitProvisionalLoad(bool is_new_navigation, | 41 void DidCommitProvisionalLoad(bool is_new_navigation, |
| 42 bool is_same_page_navigation) override; | 42 bool is_same_page_navigation) override; |
| 43 void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override; | |
| 44 | 43 |
| 45 // IPC handlers | 44 // IPC handlers |
| 46 void OnSetIsPrerendering(bool is_prerendering); | 45 void OnSetIsPrerendering(bool is_prerendering); |
| 47 void OnRequestReloadImageForContextNode(); | 46 void OnRequestReloadImageForContextNode(); |
| 48 void OnRequestThumbnailForContextNode( | 47 void OnRequestThumbnailForContextNode( |
| 49 int thumbnail_min_area_pixels, | 48 int thumbnail_min_area_pixels, |
| 50 const gfx::Size& thumbnail_max_size_pixels, | 49 const gfx::Size& thumbnail_max_size_pixels, |
| 51 int callback_id); | 50 int callback_id); |
| 52 void OnPrintNodeUnderContextMenu(); | 51 void OnPrintNodeUnderContextMenu(); |
| 53 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 52 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
| 54 void OnAppBannerPromptRequest(int request_id, | 53 void OnAppBannerPromptRequest(int request_id, |
| 55 const std::string& platform); | 54 const std::string& platform); |
| 56 | 55 |
| 57 // Captures page information using the top (main) frame of a frame tree. | 56 // Captures page information using the top (main) frame of a frame tree. |
| 58 // Currently, this page information is just the text content of the all | 57 // Currently, this page information is just the text content of the all |
| 59 // frames, collected and concatenated until a certain limit (kMaxIndexChars) | 58 // frames, collected and concatenated until a certain limit (kMaxIndexChars) |
| 60 // is reached. | 59 // is reached. |
| 61 // TODO(dglazkov): This is incompatible with OOPIF and needs to be updated. | 60 // TODO(dglazkov): This is incompatible with OOPIF and needs to be updated. |
| 62 void CapturePageText(TextCaptureType capture_type); | 61 void CapturePageText(TextCaptureType capture_type); |
| 63 | 62 |
| 64 void CapturePageTextLater(TextCaptureType capture_type, | 63 void CapturePageTextLater(TextCaptureType capture_type, |
| 65 base::TimeDelta delay); | 64 base::TimeDelta delay); |
| 66 | 65 |
| 66 // Used to delay calling CapturePageInfo. |
| 67 base::Timer capture_timer_; |
| 68 |
| 67 // Have the same lifetime as us. | 69 // Have the same lifetime as us. |
| 68 translate::TranslateHelper* translate_helper_; | 70 translate::TranslateHelper* translate_helper_; |
| 69 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; | 71 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; |
| 70 | 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); | 73 DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 #endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ | 76 #endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ |
| OLD | NEW |