| 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 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 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 private: | 54 private: |
| 55 // Holds the information received in OnWebUIJavaScript for later use | 55 // Holds the information received in OnWebUIJavaScript for later use |
| 56 // to call EvaluateScript() to preload javascript for WebUI tests. | 56 // to call EvaluateScript() to preload javascript for WebUI tests. |
| 57 struct WebUIJavaScript { | 57 struct WebUIJavaScript { |
| 58 string16 frame_xpath; | 58 string16 frame_xpath; |
| 59 string16 jscript; | 59 string16 jscript; |
| 60 int id; | 60 int id; |
| 61 bool notify_result; | 61 bool notify_result; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 static bool HasRefreshMetaTag(WebKit::WebFrame* frame); |
| 65 |
| 64 // RenderViewObserver implementation. | 66 // RenderViewObserver implementation. |
| 65 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 67 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 66 virtual void DidStartLoading() OVERRIDE; | 68 virtual void DidStartLoading() OVERRIDE; |
| 67 virtual void DidStopLoading() OVERRIDE; | 69 virtual void DidStopLoading() OVERRIDE; |
| 68 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 70 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, |
| 69 bool is_new_navigation) OVERRIDE; | 71 bool is_new_navigation) OVERRIDE; |
| 70 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 72 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
| 71 virtual void DidHandleGestureEvent( | 73 virtual void DidHandleGestureEvent( |
| 72 const WebKit::WebGestureEvent& event) OVERRIDE; | 74 const WebKit::WebGestureEvent& event) OVERRIDE; |
| 73 | 75 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void OnJavaScriptStressTestControl(int cmd, int param); | 134 void OnJavaScriptStressTestControl(int cmd, int param); |
| 133 void OnSetIsPrerendering(bool is_prerendering); | 135 void OnSetIsPrerendering(bool is_prerendering); |
| 134 void OnSetAllowDisplayingInsecureContent(bool allow); | 136 void OnSetAllowDisplayingInsecureContent(bool allow); |
| 135 void OnSetAllowRunningInsecureContent(bool allow); | 137 void OnSetAllowRunningInsecureContent(bool allow); |
| 136 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 138 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
| 137 void OnSetVisuallyDeemphasized(bool deemphasized); | 139 void OnSetVisuallyDeemphasized(bool deemphasized); |
| 138 void OnStartFrameSniffer(const string16& frame_name); | 140 void OnStartFrameSniffer(const string16& frame_name); |
| 139 void OnGetFPS(); | 141 void OnGetFPS(); |
| 140 void OnAddStrictSecurityHost(const std::string& host); | 142 void OnAddStrictSecurityHost(const std::string& host); |
| 141 | 143 |
| 142 void CapturePageInfoLater(bool preliminary_capture, base::TimeDelta delay); | 144 void CapturePageInfoLater(int page_id, |
| 145 bool has_refresh, |
| 146 bool preliminary_capture, |
| 147 base::TimeDelta delay); |
| 143 | 148 |
| 144 // Captures the thumbnail and text contents for indexing for the given load | 149 // Captures the thumbnail and text contents for indexing for the given load |
| 145 // ID. Kicks off analysis of the captured text. | 150 // ID. Kicks off analysis of the captured text. |
| 146 void CapturePageInfo(bool preliminary_capture); | 151 void CapturePageInfo(int page_id, bool has_refresh, bool preliminary_capture); |
| 147 | 152 |
| 148 // Retrieves the text from the given frame contents, the page text up to the | 153 // Retrieves the text from the given frame contents, the page text up to the |
| 149 // maximum amount kMaxIndexChars will be placed into the given buffer. | 154 // maximum amount kMaxIndexChars will be placed into the given buffer. |
| 150 void CaptureText(WebKit::WebFrame* frame, string16* contents); | 155 void CaptureText(WebKit::WebFrame* frame, string16* contents); |
| 151 | 156 |
| 152 ExternalHostBindings* GetExternalHostBindings(); | 157 ExternalHostBindings* GetExternalHostBindings(); |
| 153 | 158 |
| 154 // Determines if a host is in the strict security host set. | 159 // Determines if a host is in the strict security host set. |
| 155 bool IsStrictSecurityHost(const std::string& host); | 160 bool IsStrictSecurityHost(const std::string& host); |
| 156 | 161 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // A color page overlay when visually de-emaphasized. | 195 // A color page overlay when visually de-emaphasized. |
| 191 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 196 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
| 192 | 197 |
| 193 // Used to delay calling CapturePageInfo. | 198 // Used to delay calling CapturePageInfo. |
| 194 base::Timer capture_timer_; | 199 base::Timer capture_timer_; |
| 195 | 200 |
| 196 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 201 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
| 197 }; | 202 }; |
| 198 | 203 |
| 199 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 204 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |