| 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(); |
| 129 void OnHandleMessageFromExternalHost(const std::string& message, | 130 void OnHandleMessageFromExternalHost(const std::string& message, |
| 130 const std::string& origin, | 131 const std::string& origin, |
| 131 const std::string& target); | 132 const std::string& target); |
| 132 void OnJavaScriptStressTestControl(int cmd, int param); | 133 void OnJavaScriptStressTestControl(int cmd, int param); |
| 133 void OnSetIsPrerendering(bool is_prerendering); | 134 void OnSetIsPrerendering(bool is_prerendering); |
| 134 void OnSetAllowDisplayingInsecureContent(bool allow); | 135 void OnSetAllowDisplayingInsecureContent(bool allow); |
| 135 void OnSetAllowRunningInsecureContent(bool allow); | 136 void OnSetAllowRunningInsecureContent(bool allow); |
| 136 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 137 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
| 137 void OnSetVisuallyDeemphasized(bool deemphasized); | 138 void OnSetVisuallyDeemphasized(bool deemphasized); |
| 138 void OnStartFrameSniffer(const string16& frame_name); | 139 void OnStartFrameSniffer(const string16& frame_name); |
| 139 void OnGetFPS(); | 140 void OnGetFPS(); |
| 140 void OnAddStrictSecurityHost(const std::string& host); | 141 void OnAddStrictSecurityHost(const std::string& host); |
| 141 | 142 |
| 142 void CapturePageInfoLater(bool preliminary_capture, base::TimeDelta delay); | 143 void CapturePageInfoLater(bool preliminary_capture, base::TimeDelta delay); |
| 143 | 144 |
| 144 // Captures the thumbnail and text contents for indexing for the given load | 145 // Captures the thumbnail and text contents for indexing for the given load |
| 145 // ID. Kicks off analysis of the captured text. | 146 // ID. Kicks off analysis of the captured text. |
| 146 void CapturePageInfo(bool preliminary_capture); | 147 void CapturePageInfo(bool preliminary_capture); |
| 147 | 148 |
| 148 // Retrieves the text from the given frame contents, the page text up to the | 149 // 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. | 150 // maximum amount kMaxIndexChars will be placed into the given buffer. |
| 150 void CaptureText(WebKit::WebFrame* frame, string16* contents); | 151 void CaptureText(WebKit::WebFrame* frame, string16* contents); |
| 151 | 152 |
| 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 |
| 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 |
| 157 // If |origin| corresponds to an installed extension, returns that extension. | 162 // If |origin| corresponds to an installed extension, returns that extension. |
| 158 // Otherwise returns NULL. | 163 // Otherwise returns NULL. |
| 159 const extensions::Extension* GetExtension( | 164 const extensions::Extension* GetExtension( |
| 160 const WebKit::WebSecurityOrigin& origin) const; | 165 const WebKit::WebSecurityOrigin& origin) const; |
| 161 | 166 |
| (...skipping 28 matching lines...) Expand all 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 |