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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace WebKit { | 29 namespace WebKit { |
30 class WebView; | 30 class WebView; |
31 } | 31 } |
32 | 32 |
33 namespace safe_browsing { | 33 namespace safe_browsing { |
34 class PhishingClassifierDelegate; | 34 class PhishingClassifierDelegate; |
35 } | 35 } |
36 | 36 |
37 namespace webkit_glue { | 37 namespace webkit_glue { |
38 class ImageResourceFetcher; | 38 class MultiResolutionImageResourceFetcher; |
39 } | 39 } |
40 | 40 |
41 // This class holds the Chrome specific parts of RenderView, and has the same | 41 // This class holds the Chrome specific parts of RenderView, and has the same |
42 // lifetime. | 42 // lifetime. |
43 class ChromeRenderViewObserver : public content::RenderViewObserver, | 43 class ChromeRenderViewObserver : public content::RenderViewObserver, |
44 public WebKit::WebPermissionClient { | 44 public WebKit::WebPermissionClient { |
45 public: | 45 public: |
46 // translate_helper can be NULL. | 46 // translate_helper can be NULL. |
47 ChromeRenderViewObserver( | 47 ChromeRenderViewObserver( |
48 content::RenderView* render_view, | 48 content::RenderView* render_view, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Capture a snapshot of a view. This is used to allow an extension | 161 // Capture a snapshot of a view. This is used to allow an extension |
162 // to get a snapshot of a tab using chrome.tabs.captureVisibleTab(). | 162 // to get a snapshot of a tab using chrome.tabs.captureVisibleTab(). |
163 bool CaptureSnapshot(WebKit::WebView* view, SkBitmap* snapshot); | 163 bool CaptureSnapshot(WebKit::WebView* view, SkBitmap* snapshot); |
164 | 164 |
165 ExternalHostBindings* GetExternalHostBindings(); | 165 ExternalHostBindings* GetExternalHostBindings(); |
166 | 166 |
167 // This callback is triggered when DownloadFavicon completes, either | 167 // This callback is triggered when DownloadFavicon completes, either |
168 // succesfully or with a failure. See DownloadFavicon for more | 168 // succesfully or with a failure. See DownloadFavicon for more |
169 // details. | 169 // details. |
170 void DidDownloadFavicon(webkit_glue::ImageResourceFetcher* fetcher, | 170 void DidDownloadFavicon( |
171 const SkBitmap& image); | 171 int requested_size, |
| 172 webkit_glue::MultiResolutionImageResourceFetcher* fetcher, |
| 173 const std::vector<SkBitmap>& images); |
172 | 174 |
173 // Requests to download a favicon image. When done, the RenderView | 175 // Requests to download a favicon image. When done, the RenderView |
174 // is notified by way of DidDownloadFavicon. Returns true if the | 176 // is notified by way of DidDownloadFavicon. Returns true if the |
175 // request was successfully started, false otherwise. id is used to | 177 // request was successfully started, false otherwise. id is used to |
176 // uniquely identify the request and passed back to the | 178 // uniquely identify the request and passed back to the |
177 // DidDownloadFavicon method. If the image has multiple frames, the | 179 // DidDownloadFavicon method. If the image has multiple frames, the |
178 // 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 |
179 // have a frame at the specified size, the first is returned. | 181 // have a frame at the specified size, the first is returned. |
180 bool DownloadFavicon(int id, const GURL& image_url, int image_size); | 182 bool DownloadFavicon(int id, const GURL& image_url, int image_size); |
181 | 183 |
(...skipping 29 matching lines...) Expand all Loading... |
211 GURL last_indexed_url_; | 213 GURL last_indexed_url_; |
212 | 214 |
213 // Insecure content may be permitted for the duration of this render view. | 215 // Insecure content may be permitted for the duration of this render view. |
214 bool allow_displaying_insecure_content_; | 216 bool allow_displaying_insecure_content_; |
215 bool allow_running_insecure_content_; | 217 bool allow_running_insecure_content_; |
216 std::set<std::string> strict_security_hosts_; | 218 std::set<std::string> strict_security_hosts_; |
217 | 219 |
218 // External host exposed through automation controller. | 220 // External host exposed through automation controller. |
219 scoped_ptr<ExternalHostBindings> external_host_bindings_; | 221 scoped_ptr<ExternalHostBindings> external_host_bindings_; |
220 | 222 |
221 typedef std::vector<linked_ptr<webkit_glue::ImageResourceFetcher> > | 223 typedef std::vector< |
222 ImageResourceFetcherList; | 224 linked_ptr<webkit_glue::MultiResolutionImageResourceFetcher> > |
| 225 ImageResourceFetcherList; |
223 | 226 |
224 // ImageResourceFetchers schedule via DownloadImage. | 227 // ImageResourceFetchers schedule via DownloadImage. |
225 ImageResourceFetcherList image_fetchers_; | 228 ImageResourceFetcherList image_fetchers_; |
226 | 229 |
227 // A color page overlay when visually de-emaphasized. | 230 // A color page overlay when visually de-emaphasized. |
228 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 231 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
229 | 232 |
230 // Used to delay calling CapturePageInfo. | 233 // Used to delay calling CapturePageInfo. |
231 base::Timer capture_timer_; | 234 base::Timer capture_timer_; |
232 | 235 |
233 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 236 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
234 }; | 237 }; |
235 | 238 |
236 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 239 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |