 Chromium Code Reviews
 Chromium Code Reviews Issue 2900563002:
  Network service: Safe browsing check for sub-resources from renderer.  (Closed)
    
  
    Issue 2900563002:
  Network service: Safe browsing check for sub-resources from renderer.  (Closed) 
  | 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 "chrome/common/image_context_menu_renderer.mojom.h" | 10 #include "chrome/common/image_context_menu_renderer.mojom.h" | 
| 11 #include "chrome/common/prerender_types.h" | 11 #include "chrome/common/prerender_types.h" | 
| 12 #include "chrome/common/thumbnail_capturer.mojom.h" | 12 #include "chrome/common/thumbnail_capturer.mojom.h" | 
| 13 #include "content/public/renderer/render_frame_observer.h" | 13 #include "content/public/renderer/render_frame_observer.h" | 
| 14 #include "mojo/public/cpp/bindings/binding_set.h" | 14 #include "mojo/public/cpp/bindings/binding_set.h" | 
| 15 #include "services/service_manager/public/cpp/bind_source_info.h" | 15 #include "services/service_manager/public/cpp/bind_source_info.h" | 
| 16 | 16 | 
| 17 namespace gfx { | 17 namespace gfx { | 
| 18 class Size; | 18 class Size; | 
| 19 } | 19 } | 
| 20 | 20 | 
| 21 namespace safe_browsing { | 21 namespace safe_browsing { | 
| 22 class PhishingClassifierDelegate; | 22 class PhishingClassifierDelegate; | 
| 23 } | 23 } | 
| 24 | 24 | 
| 25 namespace translate { | 25 namespace translate { | 
| 26 class TranslateHelper; | 26 class TranslateHelper; | 
| 27 } | 27 } | 
| 28 | 28 | 
| 29 class ChromeContentRendererClient; | |
| 30 | |
| 29 // This class holds the Chrome specific parts of RenderFrame, and has the same | 31 // This class holds the Chrome specific parts of RenderFrame, and has the same | 
| 30 // lifetime. | 32 // lifetime. | 
| 31 class ChromeRenderFrameObserver | 33 class ChromeRenderFrameObserver | 
| 32 : public content::RenderFrameObserver, | 34 : public content::RenderFrameObserver, | 
| 33 public chrome::mojom::ImageContextMenuRenderer, | 35 public chrome::mojom::ImageContextMenuRenderer, | 
| 34 public chrome::mojom::ThumbnailCapturer { | 36 public chrome::mojom::ThumbnailCapturer { | 
| 35 public: | 37 public: | 
| 36 explicit ChromeRenderFrameObserver(content::RenderFrame* render_frame); | 38 explicit ChromeRenderFrameObserver(ChromeContentRendererClient* client, | 
| 
kinuko
2017/05/25 11:30:57
nit: no explicit
 
yzshen1
2017/05/26 20:43:52
Done.
 | |
| 39 content::RenderFrame* render_frame); | |
| 37 ~ChromeRenderFrameObserver() override; | 40 ~ChromeRenderFrameObserver() override; | 
| 38 | 41 | 
| 39 private: | 42 private: | 
| 40 enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; | 43 enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; | 
| 41 | 44 | 
| 42 // RenderFrameObserver implementation. | 45 // RenderFrameObserver implementation. | 
| 43 bool OnMessageReceived(const IPC::Message& message) override; | 46 bool OnMessageReceived(const IPC::Message& message) override; | 
| 44 void DidStartProvisionalLoad(blink::WebDataSource* data_source) override; | 47 void DidStartProvisionalLoad(blink::WebDataSource* data_source) override; | 
| 45 void DidFinishLoad() override; | 48 void DidFinishLoad() override; | 
| 46 void DidCommitProvisionalLoad(bool is_new_navigation, | 49 void DidCommitProvisionalLoad(bool is_new_navigation, | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // Have the same lifetime as us. | 90 // Have the same lifetime as us. | 
| 88 translate::TranslateHelper* translate_helper_; | 91 translate::TranslateHelper* translate_helper_; | 
| 89 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; | 92 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; | 
| 90 | 93 | 
| 91 mojo::BindingSet<chrome::mojom::ImageContextMenuRenderer> | 94 mojo::BindingSet<chrome::mojom::ImageContextMenuRenderer> | 
| 92 image_context_menu_renderer_bindings_; | 95 image_context_menu_renderer_bindings_; | 
| 93 | 96 | 
| 94 mojo::BindingSet<chrome::mojom::ThumbnailCapturer> | 97 mojo::BindingSet<chrome::mojom::ThumbnailCapturer> | 
| 95 thumbnail_capturer_bindings_; | 98 thumbnail_capturer_bindings_; | 
| 96 | 99 | 
| 100 ChromeContentRendererClient* const client_; | |
| 101 | |
| 97 DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); | 102 DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); | 
| 98 }; | 103 }; | 
| 99 | 104 | 
| 100 #endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ | 105 #endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ | 
| OLD | NEW |