| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_VIEW_OBSERVER_H_ | 5 #ifndef CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
| 6 #define CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 6 #define CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace webkit_glue { | 34 namespace webkit_glue { |
| 35 class ImageResourceFetcher; | 35 class ImageResourceFetcher; |
| 36 } | 36 } |
| 37 | 37 |
| 38 // This class holds the Chrome specific parts of RenderView, and has the same | 38 // This class holds the Chrome specific parts of RenderView, and has the same |
| 39 // lifetime. | 39 // lifetime. |
| 40 class ChromeRenderViewObserver : public RenderViewObserver, | 40 class ChromeRenderViewObserver : public RenderViewObserver, |
| 41 public WebKit::WebPageSerializerClient, | 41 public WebKit::WebPageSerializerClient, |
| 42 public WebKit::WebPermissionClient { | 42 public WebKit::WebPermissionClient { |
| 43 public: | 43 public: |
| 44 // translate_helper and/or phishing_classifier can be NULL. | 44 // translate_helper can be NULL. |
| 45 ChromeRenderViewObserver( | 45 ChromeRenderViewObserver( |
| 46 RenderView* render_view, | 46 RenderView* render_view, |
| 47 ContentSettingsObserver* content_settings, | 47 ContentSettingsObserver* content_settings, |
| 48 ExtensionDispatcher* extension_dispatcher, | 48 ExtensionDispatcher* extension_dispatcher, |
| 49 TranslateHelper* translate_helper, | 49 TranslateHelper* translate_helper); |
| 50 safe_browsing::PhishingClassifierDelegate* phishing_classifier); | |
| 51 virtual ~ChromeRenderViewObserver(); | 50 virtual ~ChromeRenderViewObserver(); |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 // RenderViewObserver implementation. | 53 // RenderViewObserver implementation. |
| 55 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 54 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 56 virtual void DidStopLoading() OVERRIDE; | 55 virtual void DidStopLoading() OVERRIDE; |
| 57 virtual void DidChangeIcon(WebKit::WebFrame* frame, | 56 virtual void DidChangeIcon(WebKit::WebFrame* frame, |
| 58 WebKit::WebIconURL::Type icon_type) OVERRIDE; | 57 WebKit::WebIconURL::Type icon_type) OVERRIDE; |
| 59 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 58 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, |
| 60 bool is_new_navigation) OVERRIDE; | 59 bool is_new_navigation) OVERRIDE; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( | 110 void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( |
| 112 const std::vector<GURL>& links, | 111 const std::vector<GURL>& links, |
| 113 const std::vector<FilePath>& local_paths, | 112 const std::vector<FilePath>& local_paths, |
| 114 const FilePath& local_directory_name); | 113 const FilePath& local_directory_name); |
| 115 void OnDownloadFavicon(int id, const GURL& image_url, int image_size); | 114 void OnDownloadFavicon(int id, const GURL& image_url, int image_size); |
| 116 void OnEnableViewSourceMode(); | 115 void OnEnableViewSourceMode(); |
| 117 void OnNavigate(const ViewMsg_Navigate_Params& params); | 116 void OnNavigate(const ViewMsg_Navigate_Params& params); |
| 118 void OnSetIsPrerendering(bool is_prerendering); | 117 void OnSetIsPrerendering(bool is_prerendering); |
| 119 void OnSetAllowDisplayingInsecureContent(bool allow); | 118 void OnSetAllowDisplayingInsecureContent(bool allow); |
| 120 void OnSetAllowRunningInsecureContent(bool allow); | 119 void OnSetAllowRunningInsecureContent(bool allow); |
| 120 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
| 121 | 121 |
| 122 // Captures the thumbnail and text contents for indexing for the given load | 122 // Captures the thumbnail and text contents for indexing for the given load |
| 123 // ID. If the view's load ID is different than the parameter, this call is | 123 // ID. If the view's load ID is different than the parameter, this call is |
| 124 // a NOP. Typically called on a timer, so the load ID may have changed in the | 124 // a NOP. Typically called on a timer, so the load ID may have changed in the |
| 125 // meantime. | 125 // meantime. |
| 126 void CapturePageInfo(int load_id, bool preliminary_capture); | 126 void CapturePageInfo(int load_id, bool preliminary_capture); |
| 127 | 127 |
| 128 // Retrieves the text from the given frame contents, the page text up to the | 128 // Retrieves the text from the given frame contents, the page text up to the |
| 129 // maximum amount kMaxIndexChars will be placed into the given buffer. | 129 // maximum amount kMaxIndexChars will be placed into the given buffer. |
| 130 void CaptureText(WebKit::WebFrame* frame, string16* contents); | 130 void CaptureText(WebKit::WebFrame* frame, string16* contents); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 ScopedRunnableMethodFactory<ChromeRenderViewObserver> | 189 ScopedRunnableMethodFactory<ChromeRenderViewObserver> |
| 190 page_info_method_factory_; | 190 page_info_method_factory_; |
| 191 | 191 |
| 192 // ImageResourceFetchers schedule via DownloadImage. | 192 // ImageResourceFetchers schedule via DownloadImage. |
| 193 RenderView::ImageResourceFetcherList image_fetchers_; | 193 RenderView::ImageResourceFetcherList image_fetchers_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 195 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 198 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |