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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 string16 frame_xpath; | 59 string16 frame_xpath; |
60 string16 jscript; | 60 string16 jscript; |
61 int id; | 61 int id; |
62 bool notify_result; | 62 bool notify_result; |
63 }; | 63 }; |
64 | 64 |
65 // RenderViewObserver implementation. | 65 // RenderViewObserver implementation. |
66 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 66 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
67 virtual void DidStartLoading() OVERRIDE; | 67 virtual void DidStartLoading() OVERRIDE; |
68 virtual void DidStopLoading() OVERRIDE; | 68 virtual void DidStopLoading() OVERRIDE; |
69 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; | |
70 virtual void DidChangeIcon(WebKit::WebFrame* frame, | 69 virtual void DidChangeIcon(WebKit::WebFrame* frame, |
71 WebKit::WebIconURL::Type icon_type) OVERRIDE; | 70 WebKit::WebIconURL::Type icon_type) OVERRIDE; |
72 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 71 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, |
73 bool is_new_navigation) OVERRIDE; | 72 bool is_new_navigation) OVERRIDE; |
74 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 73 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
75 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) OVERRIDE; | 74 virtual void DidHandleTouchEvent(const WebKit::WebTouchEvent& event) OVERRIDE; |
76 | 75 |
77 // WebKit::WebPermissionClient implementation. | 76 // WebKit::WebPermissionClient implementation. |
78 virtual bool allowDatabase(WebKit::WebFrame* frame, | 77 virtual bool allowDatabase(WebKit::WebFrame* frame, |
79 const WebKit::WebString& name, | 78 const WebKit::WebString& name, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // request was successfully started, false otherwise. id is used to | 177 // request was successfully started, false otherwise. id is used to |
179 // uniquely identify the request and passed back to the | 178 // uniquely identify the request and passed back to the |
180 // DidDownloadFavicon method. If the image has multiple frames, the | 179 // DidDownloadFavicon method. If the image has multiple frames, the |
181 // frame whose size is image_size is returned. If the image doesn't | 180 // frame whose size is image_size is returned. If the image doesn't |
182 // have a frame at the specified size, the first is returned. | 181 // have a frame at the specified size, the first is returned. |
183 bool DownloadFavicon(int id, const GURL& image_url, int image_size); | 182 bool DownloadFavicon(int id, const GURL& image_url, int image_size); |
184 | 183 |
185 // Decodes a data: URL image or returns an empty image in case of failure. | 184 // Decodes a data: URL image or returns an empty image in case of failure. |
186 SkBitmap ImageFromDataUrl(const GURL&) const; | 185 SkBitmap ImageFromDataUrl(const GURL&) const; |
187 | 186 |
188 // Collects favicons of given types from the frame and sends UpdateFaviconURL. | |
189 void CollectAndUpdateFaviconURLs(WebKit::WebFrame* frame, int icon_types); | |
190 | |
191 // Determines if a host is in the strict security host set. | 187 // Determines if a host is in the strict security host set. |
192 bool IsStrictSecurityHost(const std::string& host); | 188 bool IsStrictSecurityHost(const std::string& host); |
193 | 189 |
194 // Checks if |origin| correponds to an installed extension that has been | 190 // Checks if |origin| correponds to an installed extension that has been |
195 // granted the |permission|. | 191 // granted the |permission|. |
196 bool HasExtensionPermission(const WebKit::WebSecurityOrigin& origin, | 192 bool HasExtensionPermission(const WebKit::WebSecurityOrigin& origin, |
197 extensions::APIPermission::ID permission) const; | 193 extensions::APIPermission::ID permission) const; |
198 | 194 |
199 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. | 195 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. |
200 scoped_ptr<WebUIJavaScript> webui_javascript_; | 196 scoped_ptr<WebUIJavaScript> webui_javascript_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // A color page overlay when visually de-emaphasized. | 230 // A color page overlay when visually de-emaphasized. |
235 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 231 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
236 | 232 |
237 // Used to delay calling CapturePageInfo. | 233 // Used to delay calling CapturePageInfo. |
238 base::Timer capture_timer_; | 234 base::Timer capture_timer_; |
239 | 235 |
240 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 236 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
241 }; | 237 }; |
242 | 238 |
243 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 239 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |