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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 content::RenderView* render_view, | 52 content::RenderView* render_view, |
53 ContentSettingsObserver* content_settings, | 53 ContentSettingsObserver* content_settings, |
54 ChromeRenderProcessObserver* chrome_render_process_observer, | 54 ChromeRenderProcessObserver* chrome_render_process_observer, |
55 extensions::Dispatcher* extension_dispatcher); | 55 extensions::Dispatcher* extension_dispatcher); |
56 virtual ~ChromeRenderViewObserver(); | 56 virtual ~ChromeRenderViewObserver(); |
57 | 57 |
58 private: | 58 private: |
59 // Holds the information received in OnWebUIJavaScript for later use | 59 // Holds the information received in OnWebUIJavaScript for later use |
60 // to call EvaluateScript() to preload javascript for WebUI tests. | 60 // to call EvaluateScript() to preload javascript for WebUI tests. |
61 struct WebUIJavaScript { | 61 struct WebUIJavaScript { |
62 string16 frame_xpath; | 62 base::string16 frame_xpath; |
63 string16 jscript; | 63 base::string16 jscript; |
64 int id; | 64 int id; |
65 bool notify_result; | 65 bool notify_result; |
66 }; | 66 }; |
67 | 67 |
68 // RenderViewObserver implementation. | 68 // RenderViewObserver implementation. |
69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
70 virtual void DidStartLoading() OVERRIDE; | 70 virtual void DidStartLoading() OVERRIDE; |
71 virtual void DidStopLoading() OVERRIDE; | 71 virtual void DidStopLoading() OVERRIDE; |
72 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, | 72 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, |
73 bool is_new_navigation) OVERRIDE; | 73 bool is_new_navigation) OVERRIDE; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bool allowed_per_settings, | 116 bool allowed_per_settings, |
117 const blink::WebSecurityOrigin& context, | 117 const blink::WebSecurityOrigin& context, |
118 const blink::WebURL& url); | 118 const blink::WebURL& url); |
119 virtual bool allowRunningInsecureContent( | 119 virtual bool allowRunningInsecureContent( |
120 blink::WebFrame* frame, | 120 blink::WebFrame* frame, |
121 bool allowed_per_settings, | 121 bool allowed_per_settings, |
122 const blink::WebSecurityOrigin& context, | 122 const blink::WebSecurityOrigin& context, |
123 const blink::WebURL& url); | 123 const blink::WebURL& url); |
124 virtual void Navigate(const GURL& url) OVERRIDE; | 124 virtual void Navigate(const GURL& url) OVERRIDE; |
125 | 125 |
126 void OnWebUIJavaScript(const string16& frame_xpath, | 126 void OnWebUIJavaScript(const base::string16& frame_xpath, |
127 const string16& jscript, | 127 const base::string16& jscript, |
128 int id, | 128 int id, |
129 bool notify_result); | 129 bool notify_result); |
130 void OnHandleMessageFromExternalHost(const std::string& message, | 130 void OnHandleMessageFromExternalHost(const std::string& message, |
131 const std::string& origin, | 131 const std::string& origin, |
132 const std::string& target); | 132 const std::string& target); |
133 void OnJavaScriptStressTestControl(int cmd, int param); | 133 void OnJavaScriptStressTestControl(int cmd, int param); |
134 void OnSetIsPrerendering(bool is_prerendering); | 134 void OnSetIsPrerendering(bool is_prerendering); |
135 void OnSetAllowDisplayingInsecureContent(bool allow); | 135 void OnSetAllowDisplayingInsecureContent(bool allow); |
136 void OnSetAllowRunningInsecureContent(bool allow); | 136 void OnSetAllowRunningInsecureContent(bool allow); |
137 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 137 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
(...skipping 13 matching lines...) Expand all Loading... |
151 void CapturePageInfoLater(int page_id, | 151 void CapturePageInfoLater(int page_id, |
152 bool preliminary_capture, | 152 bool preliminary_capture, |
153 base::TimeDelta delay); | 153 base::TimeDelta delay); |
154 | 154 |
155 // Captures the thumbnail and text contents for indexing for the given load | 155 // Captures the thumbnail and text contents for indexing for the given load |
156 // ID. Kicks off analysis of the captured text. | 156 // ID. Kicks off analysis of the captured text. |
157 void CapturePageInfo(int page_id, bool preliminary_capture); | 157 void CapturePageInfo(int page_id, bool preliminary_capture); |
158 | 158 |
159 // Retrieves the text from the given frame contents, the page text up to the | 159 // Retrieves the text from the given frame contents, the page text up to the |
160 // maximum amount kMaxIndexChars will be placed into the given buffer. | 160 // maximum amount kMaxIndexChars will be placed into the given buffer. |
161 void CaptureText(blink::WebFrame* frame, string16* contents); | 161 void CaptureText(blink::WebFrame* frame, base::string16* contents); |
162 | 162 |
163 ExternalHostBindings* GetExternalHostBindings(); | 163 ExternalHostBindings* GetExternalHostBindings(); |
164 | 164 |
165 // Determines if a host is in the strict security host set. | 165 // Determines if a host is in the strict security host set. |
166 bool IsStrictSecurityHost(const std::string& host); | 166 bool IsStrictSecurityHost(const std::string& host); |
167 | 167 |
168 // If |origin| corresponds to an installed extension, returns that extension. | 168 // If |origin| corresponds to an installed extension, returns that extension. |
169 // Otherwise returns NULL. | 169 // Otherwise returns NULL. |
170 const extensions::Extension* GetExtension( | 170 const extensions::Extension* GetExtension( |
171 const blink::WebSecurityOrigin& origin) const; | 171 const blink::WebSecurityOrigin& origin) const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // A color page overlay when visually de-emaphasized. | 203 // A color page overlay when visually de-emaphasized. |
204 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 204 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
205 | 205 |
206 // Used to delay calling CapturePageInfo. | 206 // Used to delay calling CapturePageInfo. |
207 base::Timer capture_timer_; | 207 base::Timer capture_timer_; |
208 | 208 |
209 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 209 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
210 }; | 210 }; |
211 | 211 |
212 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 212 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |