| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 WebKit::WebFrame* frame, | 119 WebKit::WebFrame* frame, |
| 120 bool allowed_per_settings, | 120 bool allowed_per_settings, |
| 121 const WebKit::WebSecurityOrigin& context, | 121 const WebKit::WebSecurityOrigin& context, |
| 122 const WebKit::WebURL& url) OVERRIDE; | 122 const WebKit::WebURL& url) OVERRIDE; |
| 123 virtual void Navigate(const GURL& url) OVERRIDE; | 123 virtual void Navigate(const GURL& url) OVERRIDE; |
| 124 | 124 |
| 125 void OnWebUIJavaScript(const string16& frame_xpath, | 125 void OnWebUIJavaScript(const string16& frame_xpath, |
| 126 const string16& jscript, | 126 const string16& jscript, |
| 127 int id, | 127 int id, |
| 128 bool notify_result); | 128 bool notify_result); |
| 129 void OnCaptureSnapshot(); | |
| 130 void OnHandleMessageFromExternalHost(const std::string& message, | 129 void OnHandleMessageFromExternalHost(const std::string& message, |
| 131 const std::string& origin, | 130 const std::string& origin, |
| 132 const std::string& target); | 131 const std::string& target); |
| 133 void OnJavaScriptStressTestControl(int cmd, int param); | 132 void OnJavaScriptStressTestControl(int cmd, int param); |
| 134 void OnSetIsPrerendering(bool is_prerendering); | 133 void OnSetIsPrerendering(bool is_prerendering); |
| 135 void OnSetAllowDisplayingInsecureContent(bool allow); | 134 void OnSetAllowDisplayingInsecureContent(bool allow); |
| 136 void OnSetAllowRunningInsecureContent(bool allow); | 135 void OnSetAllowRunningInsecureContent(bool allow); |
| 137 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 136 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
| 138 void OnSetVisuallyDeemphasized(bool deemphasized); | 137 void OnSetVisuallyDeemphasized(bool deemphasized); |
| 139 void OnStartFrameSniffer(const string16& frame_name); | 138 void OnStartFrameSniffer(const string16& frame_name); |
| 140 void OnGetFPS(); | 139 void OnGetFPS(); |
| 141 void OnAddStrictSecurityHost(const std::string& host); | 140 void OnAddStrictSecurityHost(const std::string& host); |
| 142 | 141 |
| 143 void CapturePageInfoLater(bool preliminary_capture, base::TimeDelta delay); | 142 void CapturePageInfoLater(bool preliminary_capture, base::TimeDelta delay); |
| 144 | 143 |
| 145 // Captures the thumbnail and text contents for indexing for the given load | 144 // Captures the thumbnail and text contents for indexing for the given load |
| 146 // ID. Kicks off analysis of the captured text. | 145 // ID. Kicks off analysis of the captured text. |
| 147 void CapturePageInfo(bool preliminary_capture); | 146 void CapturePageInfo(bool preliminary_capture); |
| 148 | 147 |
| 149 // Retrieves the text from the given frame contents, the page text up to the | 148 // Retrieves the text from the given frame contents, the page text up to the |
| 150 // maximum amount kMaxIndexChars will be placed into the given buffer. | 149 // maximum amount kMaxIndexChars will be placed into the given buffer. |
| 151 void CaptureText(WebKit::WebFrame* frame, string16* contents); | 150 void CaptureText(WebKit::WebFrame* frame, string16* contents); |
| 152 | 151 |
| 153 // Capture a snapshot of a view. This is used to allow an extension | |
| 154 // to get a snapshot of a tab using chrome.tabs.captureVisibleTab(). | |
| 155 bool CaptureSnapshot(WebKit::WebView* view, SkBitmap* snapshot); | |
| 156 | |
| 157 ExternalHostBindings* GetExternalHostBindings(); | 152 ExternalHostBindings* GetExternalHostBindings(); |
| 158 | 153 |
| 159 // Determines if a host is in the strict security host set. | 154 // Determines if a host is in the strict security host set. |
| 160 bool IsStrictSecurityHost(const std::string& host); | 155 bool IsStrictSecurityHost(const std::string& host); |
| 161 | 156 |
| 162 // If |origin| corresponds to an installed extension, returns that extension. | 157 // If |origin| corresponds to an installed extension, returns that extension. |
| 163 // Otherwise returns NULL. | 158 // Otherwise returns NULL. |
| 164 const extensions::Extension* GetExtension( | 159 const extensions::Extension* GetExtension( |
| 165 const WebKit::WebSecurityOrigin& origin) const; | 160 const WebKit::WebSecurityOrigin& origin) const; |
| 166 | 161 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 195 // A color page overlay when visually de-emaphasized. | 190 // A color page overlay when visually de-emaphasized. |
| 196 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 191 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
| 197 | 192 |
| 198 // Used to delay calling CapturePageInfo. | 193 // Used to delay calling CapturePageInfo. |
| 199 base::Timer capture_timer_; | 194 base::Timer capture_timer_; |
| 200 | 195 |
| 201 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 196 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
| 202 }; | 197 }; |
| 203 | 198 |
| 204 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 199 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
| OLD | NEW |