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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
| 16 #include "chrome/common/extensions/permissions/api_permission.h" |
16 #include "content/public/renderer/render_view_observer.h" | 17 #include "content/public/renderer/render_view_observer.h" |
17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPermissionClient.h
" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPermissionClient.h
" |
19 | 20 |
20 class ChromeRenderProcessObserver; | 21 class ChromeRenderProcessObserver; |
21 class ContentSettingsObserver; | 22 class ContentSettingsObserver; |
22 class ExtensionDispatcher; | 23 class ExtensionDispatcher; |
23 class ExternalHostBindings; | 24 class ExternalHostBindings; |
24 class SkBitmap; | 25 class SkBitmap; |
25 class TranslateHelper; | 26 class TranslateHelper; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // frame whose size is image_size is returned. If the image doesn't | 177 // frame whose size is image_size is returned. If the image doesn't |
177 // have a frame at the specified size, the first is returned. | 178 // have a frame at the specified size, the first is returned. |
178 bool DownloadFavicon(int id, const GURL& image_url, int image_size); | 179 bool DownloadFavicon(int id, const GURL& image_url, int image_size); |
179 | 180 |
180 // Decodes a data: URL image or returns an empty image in case of failure. | 181 // Decodes a data: URL image or returns an empty image in case of failure. |
181 SkBitmap ImageFromDataUrl(const GURL&) const; | 182 SkBitmap ImageFromDataUrl(const GURL&) const; |
182 | 183 |
183 // Determines if a host is in the strict security host set. | 184 // Determines if a host is in the strict security host set. |
184 bool IsStrictSecurityHost(const std::string& host); | 185 bool IsStrictSecurityHost(const std::string& host); |
185 | 186 |
186 // Determines if the document has a permission to use experimental Web API | 187 // Checks if |origin| correponds to an installed extension that has been |
187 bool IsExperimentalWebFeatureAllowed(const WebKit::WebDocument& document); | 188 // granted the |permission|. |
| 189 bool HasExtensionPermission(const WebKit::WebSecurityOrigin& origin, |
| 190 extensions::APIPermission::ID permission) const; |
188 | 191 |
189 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. | 192 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. |
190 scoped_ptr<WebUIJavaScript> webui_javascript_; | 193 scoped_ptr<WebUIJavaScript> webui_javascript_; |
191 | 194 |
192 // Owned by ChromeContentRendererClient and outlive us. | 195 // Owned by ChromeContentRendererClient and outlive us. |
193 ChromeRenderProcessObserver* chrome_render_process_observer_; | 196 ChromeRenderProcessObserver* chrome_render_process_observer_; |
194 ExtensionDispatcher* extension_dispatcher_; | 197 ExtensionDispatcher* extension_dispatcher_; |
195 | 198 |
196 // Have the same lifetime as us. | 199 // Have the same lifetime as us. |
197 ContentSettingsObserver* content_settings_; | 200 ContentSettingsObserver* content_settings_; |
(...skipping 25 matching lines...) Expand all Loading... |
223 // A color page overlay when visually de-emaphasized. | 226 // A color page overlay when visually de-emaphasized. |
224 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 227 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
225 | 228 |
226 // Used to delay calling CapturePageInfo. | 229 // Used to delay calling CapturePageInfo. |
227 base::Timer capture_timer_; | 230 base::Timer capture_timer_; |
228 | 231 |
229 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 232 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
230 }; | 233 }; |
231 | 234 |
232 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 235 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |