| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/api/capture_web_contents_function.h" | 8 #include "extensions/browser/api/capture_web_contents_function.h" |
| 9 #include "extensions/browser/api/execute_code_function.h" | 9 #include "extensions/browser/api/execute_code_function.h" |
| 10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
| 11 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 11 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 12 | 12 |
| 13 // WARNING: WebViewInternal could be loaded in an unblessed context, thus any | 13 // WARNING: WebViewInternal could be loaded in an unblessed context, thus any |
| 14 // new APIs must extend WebViewInternalExtensionFunction or | 14 // new APIs must extend WebViewInternalExtensionFunction or |
| 15 // WebViewInternalExecuteCodeFunction which do a process ID check to prevent | 15 // WebViewInternalExecuteCodeFunction which do a process ID check to prevent |
| 16 // abuse by normal renderer processes. | 16 // abuse by normal renderer processes. |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 | 18 |
| 19 // An abstract base class for async webview APIs. It does a process ID check | 19 // An abstract base class for async webview APIs. It does a process ID check |
| 20 // in RunAsync, and then calls RunAsyncSafe which must be overriden by all | 20 // in RunAsync, and then calls RunAsyncSafe which must be overriden by all |
| 21 // subclasses. | 21 // subclasses. |
| 22 class WebViewInternalExtensionFunction : public AsyncExtensionFunction { | 22 class WebViewInternalExtensionFunction : public AsyncExtensionFunction { |
| 23 public: | 23 public: |
| 24 WebViewInternalExtensionFunction() {} | 24 WebViewInternalExtensionFunction() {} |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 virtual ~WebViewInternalExtensionFunction() {} | 27 virtual ~WebViewInternalExtensionFunction() {} |
| 28 | 28 |
| 29 // ExtensionFunction implementation. | 29 // ExtensionFunction implementation. |
| 30 virtual bool RunAsync() OVERRIDE FINAL; | 30 virtual bool RunAsync() override final; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 virtual bool RunAsyncSafe(WebViewGuest* guest) = 0; | 33 virtual bool RunAsyncSafe(WebViewGuest* guest) = 0; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 class WebViewInternalNavigateFunction | 36 class WebViewInternalNavigateFunction |
| 37 : public WebViewInternalExtensionFunction { | 37 : public WebViewInternalExtensionFunction { |
| 38 public: | 38 public: |
| 39 DECLARE_EXTENSION_FUNCTION("webViewInternal.navigate", | 39 DECLARE_EXTENSION_FUNCTION("webViewInternal.navigate", |
| 40 WEBVIEWINTERNAL_NAVIGATE); | 40 WEBVIEWINTERNAL_NAVIGATE); |
| 41 WebViewInternalNavigateFunction() {} | 41 WebViewInternalNavigateFunction() {} |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual ~WebViewInternalNavigateFunction() {} | 44 virtual ~WebViewInternalNavigateFunction() {} |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // WebViewInternalExtensionFunction implementation. | 47 // WebViewInternalExtensionFunction implementation. |
| 48 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 48 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(WebViewInternalNavigateFunction); | 50 DISALLOW_COPY_AND_ASSIGN(WebViewInternalNavigateFunction); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class WebViewInternalExecuteCodeFunction | 53 class WebViewInternalExecuteCodeFunction |
| 54 : public extensions::ExecuteCodeFunction { | 54 : public extensions::ExecuteCodeFunction { |
| 55 public: | 55 public: |
| 56 WebViewInternalExecuteCodeFunction(); | 56 WebViewInternalExecuteCodeFunction(); |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~WebViewInternalExecuteCodeFunction(); | 59 virtual ~WebViewInternalExecuteCodeFunction(); |
| 60 | 60 |
| 61 // Initialize |details_| if it hasn't already been. | 61 // Initialize |details_| if it hasn't already been. |
| 62 virtual bool Init() OVERRIDE; | 62 virtual bool Init() override; |
| 63 virtual bool ShouldInsertCSS() const OVERRIDE; | 63 virtual bool ShouldInsertCSS() const override; |
| 64 virtual bool CanExecuteScriptOnPage() OVERRIDE; | 64 virtual bool CanExecuteScriptOnPage() override; |
| 65 // Guarded by a process ID check. | 65 // Guarded by a process ID check. |
| 66 virtual extensions::ScriptExecutor* GetScriptExecutor() OVERRIDE FINAL; | 66 virtual extensions::ScriptExecutor* GetScriptExecutor() override final; |
| 67 virtual bool IsWebView() const OVERRIDE; | 67 virtual bool IsWebView() const override; |
| 68 virtual const GURL& GetWebViewSrc() const OVERRIDE; | 68 virtual const GURL& GetWebViewSrc() const override; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 // Contains extension resource built from path of file which is | 71 // Contains extension resource built from path of file which is |
| 72 // specified in JSON arguments. | 72 // specified in JSON arguments. |
| 73 extensions::ExtensionResource resource_; | 73 extensions::ExtensionResource resource_; |
| 74 | 74 |
| 75 int guest_instance_id_; | 75 int guest_instance_id_; |
| 76 | 76 |
| 77 GURL guest_src_; | 77 GURL guest_src_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction); | 79 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteCodeFunction); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 class WebViewInternalExecuteScriptFunction | 82 class WebViewInternalExecuteScriptFunction |
| 83 : public WebViewInternalExecuteCodeFunction { | 83 : public WebViewInternalExecuteCodeFunction { |
| 84 public: | 84 public: |
| 85 WebViewInternalExecuteScriptFunction(); | 85 WebViewInternalExecuteScriptFunction(); |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual ~WebViewInternalExecuteScriptFunction() {} | 88 virtual ~WebViewInternalExecuteScriptFunction() {} |
| 89 | 89 |
| 90 virtual void OnExecuteCodeFinished(const std::string& error, | 90 virtual void OnExecuteCodeFinished(const std::string& error, |
| 91 const GURL& on_url, | 91 const GURL& on_url, |
| 92 const base::ListValue& result) OVERRIDE; | 92 const base::ListValue& result) override; |
| 93 | 93 |
| 94 DECLARE_EXTENSION_FUNCTION("webViewInternal.executeScript", | 94 DECLARE_EXTENSION_FUNCTION("webViewInternal.executeScript", |
| 95 WEBVIEWINTERNAL_EXECUTESCRIPT) | 95 WEBVIEWINTERNAL_EXECUTESCRIPT) |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteScriptFunction); | 98 DISALLOW_COPY_AND_ASSIGN(WebViewInternalExecuteScriptFunction); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 class WebViewInternalInsertCSSFunction | 101 class WebViewInternalInsertCSSFunction |
| 102 : public WebViewInternalExecuteCodeFunction { | 102 : public WebViewInternalExecuteCodeFunction { |
| 103 public: | 103 public: |
| 104 WebViewInternalInsertCSSFunction(); | 104 WebViewInternalInsertCSSFunction(); |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 virtual ~WebViewInternalInsertCSSFunction() {} | 107 virtual ~WebViewInternalInsertCSSFunction() {} |
| 108 | 108 |
| 109 virtual bool ShouldInsertCSS() const OVERRIDE; | 109 virtual bool ShouldInsertCSS() const override; |
| 110 | 110 |
| 111 DECLARE_EXTENSION_FUNCTION("webViewInternal.insertCSS", | 111 DECLARE_EXTENSION_FUNCTION("webViewInternal.insertCSS", |
| 112 WEBVIEWINTERNAL_INSERTCSS) | 112 WEBVIEWINTERNAL_INSERTCSS) |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 DISALLOW_COPY_AND_ASSIGN(WebViewInternalInsertCSSFunction); | 115 DISALLOW_COPY_AND_ASSIGN(WebViewInternalInsertCSSFunction); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 class WebViewInternalCaptureVisibleRegionFunction | 118 class WebViewInternalCaptureVisibleRegionFunction |
| 119 : public extensions::CaptureWebContentsFunction { | 119 : public extensions::CaptureWebContentsFunction { |
| 120 DECLARE_EXTENSION_FUNCTION("webViewInternal.captureVisibleRegion", | 120 DECLARE_EXTENSION_FUNCTION("webViewInternal.captureVisibleRegion", |
| 121 WEBVIEWINTERNAL_CAPTUREVISIBLEREGION); | 121 WEBVIEWINTERNAL_CAPTUREVISIBLEREGION); |
| 122 | 122 |
| 123 WebViewInternalCaptureVisibleRegionFunction(); | 123 WebViewInternalCaptureVisibleRegionFunction(); |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 virtual ~WebViewInternalCaptureVisibleRegionFunction(); | 126 virtual ~WebViewInternalCaptureVisibleRegionFunction(); |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 // extensions::CaptureWebContentsFunction implementation. | 129 // extensions::CaptureWebContentsFunction implementation. |
| 130 virtual bool IsScreenshotEnabled() OVERRIDE; | 130 virtual bool IsScreenshotEnabled() override; |
| 131 virtual content::WebContents* GetWebContentsForID(int id) OVERRIDE; | 131 virtual content::WebContents* GetWebContentsForID(int id) override; |
| 132 virtual void OnCaptureFailure(FailureReason reason) OVERRIDE; | 132 virtual void OnCaptureFailure(FailureReason reason) override; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(WebViewInternalCaptureVisibleRegionFunction); | 134 DISALLOW_COPY_AND_ASSIGN(WebViewInternalCaptureVisibleRegionFunction); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction { | 137 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction { |
| 138 public: | 138 public: |
| 139 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName", | 139 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName", |
| 140 WEBVIEWINTERNAL_SETNAME); | 140 WEBVIEWINTERNAL_SETNAME); |
| 141 | 141 |
| 142 WebViewInternalSetNameFunction(); | 142 WebViewInternalSetNameFunction(); |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 virtual ~WebViewInternalSetNameFunction(); | 145 virtual ~WebViewInternalSetNameFunction(); |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 148 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetNameFunction); | 150 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetNameFunction); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class WebViewInternalSetAllowTransparencyFunction : | 153 class WebViewInternalSetAllowTransparencyFunction : |
| 154 public WebViewInternalExtensionFunction { | 154 public WebViewInternalExtensionFunction { |
| 155 public: | 155 public: |
| 156 DECLARE_EXTENSION_FUNCTION("webViewInternal.setAllowTransparency", | 156 DECLARE_EXTENSION_FUNCTION("webViewInternal.setAllowTransparency", |
| 157 WEBVIEWINTERNAL_SETALLOWTRANSPARENCY); | 157 WEBVIEWINTERNAL_SETALLOWTRANSPARENCY); |
| 158 | 158 |
| 159 WebViewInternalSetAllowTransparencyFunction(); | 159 WebViewInternalSetAllowTransparencyFunction(); |
| 160 | 160 |
| 161 protected: | 161 protected: |
| 162 virtual ~WebViewInternalSetAllowTransparencyFunction(); | 162 virtual ~WebViewInternalSetAllowTransparencyFunction(); |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 165 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetAllowTransparencyFunction); | 167 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetAllowTransparencyFunction); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 class WebViewInternalSetZoomFunction : public WebViewInternalExtensionFunction { | 170 class WebViewInternalSetZoomFunction : public WebViewInternalExtensionFunction { |
| 171 public: | 171 public: |
| 172 DECLARE_EXTENSION_FUNCTION("webViewInternal.setZoom", | 172 DECLARE_EXTENSION_FUNCTION("webViewInternal.setZoom", |
| 173 WEBVIEWINTERNAL_SETZOOM); | 173 WEBVIEWINTERNAL_SETZOOM); |
| 174 | 174 |
| 175 WebViewInternalSetZoomFunction(); | 175 WebViewInternalSetZoomFunction(); |
| 176 | 176 |
| 177 protected: | 177 protected: |
| 178 virtual ~WebViewInternalSetZoomFunction(); | 178 virtual ~WebViewInternalSetZoomFunction(); |
| 179 | 179 |
| 180 private: | 180 private: |
| 181 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 181 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 182 | 182 |
| 183 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetZoomFunction); | 183 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetZoomFunction); |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 class WebViewInternalGetZoomFunction : public WebViewInternalExtensionFunction { | 186 class WebViewInternalGetZoomFunction : public WebViewInternalExtensionFunction { |
| 187 public: | 187 public: |
| 188 DECLARE_EXTENSION_FUNCTION("webViewInternal.getZoom", | 188 DECLARE_EXTENSION_FUNCTION("webViewInternal.getZoom", |
| 189 WEBVIEWINTERNAL_GETZOOM); | 189 WEBVIEWINTERNAL_GETZOOM); |
| 190 | 190 |
| 191 WebViewInternalGetZoomFunction(); | 191 WebViewInternalGetZoomFunction(); |
| 192 | 192 |
| 193 protected: | 193 protected: |
| 194 virtual ~WebViewInternalGetZoomFunction(); | 194 virtual ~WebViewInternalGetZoomFunction(); |
| 195 | 195 |
| 196 private: | 196 private: |
| 197 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 197 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 198 | 198 |
| 199 DISALLOW_COPY_AND_ASSIGN(WebViewInternalGetZoomFunction); | 199 DISALLOW_COPY_AND_ASSIGN(WebViewInternalGetZoomFunction); |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 class WebViewInternalFindFunction : public WebViewInternalExtensionFunction { | 202 class WebViewInternalFindFunction : public WebViewInternalExtensionFunction { |
| 203 public: | 203 public: |
| 204 DECLARE_EXTENSION_FUNCTION("webViewInternal.find", WEBVIEWINTERNAL_FIND); | 204 DECLARE_EXTENSION_FUNCTION("webViewInternal.find", WEBVIEWINTERNAL_FIND); |
| 205 | 205 |
| 206 WebViewInternalFindFunction(); | 206 WebViewInternalFindFunction(); |
| 207 | 207 |
| 208 // Exposes SendResponse() for use by WebViewInternalFindHelper. | 208 // Exposes SendResponse() for use by WebViewInternalFindHelper. |
| 209 using WebViewInternalExtensionFunction::SendResponse; | 209 using WebViewInternalExtensionFunction::SendResponse; |
| 210 | 210 |
| 211 protected: | 211 protected: |
| 212 virtual ~WebViewInternalFindFunction(); | 212 virtual ~WebViewInternalFindFunction(); |
| 213 | 213 |
| 214 private: | 214 private: |
| 215 // WebViewInternalExtensionFunction implementation. | 215 // WebViewInternalExtensionFunction implementation. |
| 216 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 216 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 217 | 217 |
| 218 DISALLOW_COPY_AND_ASSIGN(WebViewInternalFindFunction); | 218 DISALLOW_COPY_AND_ASSIGN(WebViewInternalFindFunction); |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 class WebViewInternalStopFindingFunction | 221 class WebViewInternalStopFindingFunction |
| 222 : public WebViewInternalExtensionFunction { | 222 : public WebViewInternalExtensionFunction { |
| 223 public: | 223 public: |
| 224 DECLARE_EXTENSION_FUNCTION("webViewInternal.stopFinding", | 224 DECLARE_EXTENSION_FUNCTION("webViewInternal.stopFinding", |
| 225 WEBVIEWINTERNAL_STOPFINDING); | 225 WEBVIEWINTERNAL_STOPFINDING); |
| 226 | 226 |
| 227 WebViewInternalStopFindingFunction(); | 227 WebViewInternalStopFindingFunction(); |
| 228 | 228 |
| 229 protected: | 229 protected: |
| 230 virtual ~WebViewInternalStopFindingFunction(); | 230 virtual ~WebViewInternalStopFindingFunction(); |
| 231 | 231 |
| 232 private: | 232 private: |
| 233 // WebViewInternalExtensionFunction implementation. | 233 // WebViewInternalExtensionFunction implementation. |
| 234 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 234 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 235 | 235 |
| 236 DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFindingFunction); | 236 DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFindingFunction); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 class WebViewInternalLoadDataWithBaseUrlFunction | 239 class WebViewInternalLoadDataWithBaseUrlFunction |
| 240 : public WebViewInternalExtensionFunction { | 240 : public WebViewInternalExtensionFunction { |
| 241 public: | 241 public: |
| 242 DECLARE_EXTENSION_FUNCTION("webViewInternal.loadDataWithBaseUrl", | 242 DECLARE_EXTENSION_FUNCTION("webViewInternal.loadDataWithBaseUrl", |
| 243 WEBVIEWINTERNAL_LOADDATAWITHBASEURL); | 243 WEBVIEWINTERNAL_LOADDATAWITHBASEURL); |
| 244 | 244 |
| 245 WebViewInternalLoadDataWithBaseUrlFunction(); | 245 WebViewInternalLoadDataWithBaseUrlFunction(); |
| 246 | 246 |
| 247 protected: | 247 protected: |
| 248 virtual ~WebViewInternalLoadDataWithBaseUrlFunction(); | 248 virtual ~WebViewInternalLoadDataWithBaseUrlFunction(); |
| 249 | 249 |
| 250 private: | 250 private: |
| 251 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 251 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 252 | 252 |
| 253 DISALLOW_COPY_AND_ASSIGN(WebViewInternalLoadDataWithBaseUrlFunction); | 253 DISALLOW_COPY_AND_ASSIGN(WebViewInternalLoadDataWithBaseUrlFunction); |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 class WebViewInternalGoFunction : public WebViewInternalExtensionFunction { | 256 class WebViewInternalGoFunction : public WebViewInternalExtensionFunction { |
| 257 public: | 257 public: |
| 258 DECLARE_EXTENSION_FUNCTION("webViewInternal.go", WEBVIEWINTERNAL_GO); | 258 DECLARE_EXTENSION_FUNCTION("webViewInternal.go", WEBVIEWINTERNAL_GO); |
| 259 | 259 |
| 260 WebViewInternalGoFunction(); | 260 WebViewInternalGoFunction(); |
| 261 | 261 |
| 262 protected: | 262 protected: |
| 263 virtual ~WebViewInternalGoFunction(); | 263 virtual ~WebViewInternalGoFunction(); |
| 264 | 264 |
| 265 private: | 265 private: |
| 266 // WebViewInternalExtensionFunction implementation. | 266 // WebViewInternalExtensionFunction implementation. |
| 267 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 267 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 268 | 268 |
| 269 DISALLOW_COPY_AND_ASSIGN(WebViewInternalGoFunction); | 269 DISALLOW_COPY_AND_ASSIGN(WebViewInternalGoFunction); |
| 270 }; | 270 }; |
| 271 | 271 |
| 272 class WebViewInternalReloadFunction : public WebViewInternalExtensionFunction { | 272 class WebViewInternalReloadFunction : public WebViewInternalExtensionFunction { |
| 273 public: | 273 public: |
| 274 DECLARE_EXTENSION_FUNCTION("webViewInternal.reload", WEBVIEWINTERNAL_RELOAD); | 274 DECLARE_EXTENSION_FUNCTION("webViewInternal.reload", WEBVIEWINTERNAL_RELOAD); |
| 275 | 275 |
| 276 WebViewInternalReloadFunction(); | 276 WebViewInternalReloadFunction(); |
| 277 | 277 |
| 278 protected: | 278 protected: |
| 279 virtual ~WebViewInternalReloadFunction(); | 279 virtual ~WebViewInternalReloadFunction(); |
| 280 | 280 |
| 281 private: | 281 private: |
| 282 // WebViewInternalExtensionFunction implementation. | 282 // WebViewInternalExtensionFunction implementation. |
| 283 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 283 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 284 | 284 |
| 285 DISALLOW_COPY_AND_ASSIGN(WebViewInternalReloadFunction); | 285 DISALLOW_COPY_AND_ASSIGN(WebViewInternalReloadFunction); |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 class WebViewInternalSetPermissionFunction | 288 class WebViewInternalSetPermissionFunction |
| 289 : public WebViewInternalExtensionFunction { | 289 : public WebViewInternalExtensionFunction { |
| 290 public: | 290 public: |
| 291 DECLARE_EXTENSION_FUNCTION("webViewInternal.setPermission", | 291 DECLARE_EXTENSION_FUNCTION("webViewInternal.setPermission", |
| 292 WEBVIEWINTERNAL_SETPERMISSION); | 292 WEBVIEWINTERNAL_SETPERMISSION); |
| 293 | 293 |
| 294 WebViewInternalSetPermissionFunction(); | 294 WebViewInternalSetPermissionFunction(); |
| 295 | 295 |
| 296 protected: | 296 protected: |
| 297 virtual ~WebViewInternalSetPermissionFunction(); | 297 virtual ~WebViewInternalSetPermissionFunction(); |
| 298 | 298 |
| 299 private: | 299 private: |
| 300 // WebViewInternalExtensionFunction implementation. | 300 // WebViewInternalExtensionFunction implementation. |
| 301 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 301 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 302 | 302 |
| 303 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetPermissionFunction); | 303 DISALLOW_COPY_AND_ASSIGN(WebViewInternalSetPermissionFunction); |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 class WebViewInternalOverrideUserAgentFunction | 306 class WebViewInternalOverrideUserAgentFunction |
| 307 : public WebViewInternalExtensionFunction { | 307 : public WebViewInternalExtensionFunction { |
| 308 public: | 308 public: |
| 309 DECLARE_EXTENSION_FUNCTION("webViewInternal.overrideUserAgent", | 309 DECLARE_EXTENSION_FUNCTION("webViewInternal.overrideUserAgent", |
| 310 WEBVIEWINTERNAL_OVERRIDEUSERAGENT); | 310 WEBVIEWINTERNAL_OVERRIDEUSERAGENT); |
| 311 | 311 |
| 312 WebViewInternalOverrideUserAgentFunction(); | 312 WebViewInternalOverrideUserAgentFunction(); |
| 313 | 313 |
| 314 protected: | 314 protected: |
| 315 virtual ~WebViewInternalOverrideUserAgentFunction(); | 315 virtual ~WebViewInternalOverrideUserAgentFunction(); |
| 316 | 316 |
| 317 private: | 317 private: |
| 318 // WebViewInternalExtensionFunction implementation. | 318 // WebViewInternalExtensionFunction implementation. |
| 319 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 319 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 320 | 320 |
| 321 DISALLOW_COPY_AND_ASSIGN(WebViewInternalOverrideUserAgentFunction); | 321 DISALLOW_COPY_AND_ASSIGN(WebViewInternalOverrideUserAgentFunction); |
| 322 }; | 322 }; |
| 323 | 323 |
| 324 class WebViewInternalStopFunction : public WebViewInternalExtensionFunction { | 324 class WebViewInternalStopFunction : public WebViewInternalExtensionFunction { |
| 325 public: | 325 public: |
| 326 DECLARE_EXTENSION_FUNCTION("webViewInternal.stop", WEBVIEWINTERNAL_STOP); | 326 DECLARE_EXTENSION_FUNCTION("webViewInternal.stop", WEBVIEWINTERNAL_STOP); |
| 327 | 327 |
| 328 WebViewInternalStopFunction(); | 328 WebViewInternalStopFunction(); |
| 329 | 329 |
| 330 protected: | 330 protected: |
| 331 virtual ~WebViewInternalStopFunction(); | 331 virtual ~WebViewInternalStopFunction(); |
| 332 | 332 |
| 333 private: | 333 private: |
| 334 // WebViewInternalExtensionFunction implementation. | 334 // WebViewInternalExtensionFunction implementation. |
| 335 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 335 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 336 | 336 |
| 337 DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFunction); | 337 DISALLOW_COPY_AND_ASSIGN(WebViewInternalStopFunction); |
| 338 }; | 338 }; |
| 339 | 339 |
| 340 class WebViewInternalTerminateFunction | 340 class WebViewInternalTerminateFunction |
| 341 : public WebViewInternalExtensionFunction { | 341 : public WebViewInternalExtensionFunction { |
| 342 public: | 342 public: |
| 343 DECLARE_EXTENSION_FUNCTION("webViewInternal.terminate", | 343 DECLARE_EXTENSION_FUNCTION("webViewInternal.terminate", |
| 344 WEBVIEWINTERNAL_TERMINATE); | 344 WEBVIEWINTERNAL_TERMINATE); |
| 345 | 345 |
| 346 WebViewInternalTerminateFunction(); | 346 WebViewInternalTerminateFunction(); |
| 347 | 347 |
| 348 protected: | 348 protected: |
| 349 virtual ~WebViewInternalTerminateFunction(); | 349 virtual ~WebViewInternalTerminateFunction(); |
| 350 | 350 |
| 351 private: | 351 private: |
| 352 // WebViewInternalExtensionFunction implementation. | 352 // WebViewInternalExtensionFunction implementation. |
| 353 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 353 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 354 | 354 |
| 355 DISALLOW_COPY_AND_ASSIGN(WebViewInternalTerminateFunction); | 355 DISALLOW_COPY_AND_ASSIGN(WebViewInternalTerminateFunction); |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 class WebViewInternalClearDataFunction | 358 class WebViewInternalClearDataFunction |
| 359 : public WebViewInternalExtensionFunction { | 359 : public WebViewInternalExtensionFunction { |
| 360 public: | 360 public: |
| 361 DECLARE_EXTENSION_FUNCTION("webViewInternal.clearData", | 361 DECLARE_EXTENSION_FUNCTION("webViewInternal.clearData", |
| 362 WEBVIEWINTERNAL_CLEARDATA); | 362 WEBVIEWINTERNAL_CLEARDATA); |
| 363 | 363 |
| 364 WebViewInternalClearDataFunction(); | 364 WebViewInternalClearDataFunction(); |
| 365 | 365 |
| 366 protected: | 366 protected: |
| 367 virtual ~WebViewInternalClearDataFunction(); | 367 virtual ~WebViewInternalClearDataFunction(); |
| 368 | 368 |
| 369 private: | 369 private: |
| 370 // WebViewInternalExtensionFunction implementation. | 370 // WebViewInternalExtensionFunction implementation. |
| 371 virtual bool RunAsyncSafe(WebViewGuest* guest) OVERRIDE; | 371 virtual bool RunAsyncSafe(WebViewGuest* guest) override; |
| 372 | 372 |
| 373 uint32 GetRemovalMask(); | 373 uint32 GetRemovalMask(); |
| 374 void ClearDataDone(); | 374 void ClearDataDone(); |
| 375 | 375 |
| 376 // Removal start time. | 376 // Removal start time. |
| 377 base::Time remove_since_; | 377 base::Time remove_since_; |
| 378 // Removal mask, corresponds to StoragePartition::RemoveDataMask enum. | 378 // Removal mask, corresponds to StoragePartition::RemoveDataMask enum. |
| 379 uint32 remove_mask_; | 379 uint32 remove_mask_; |
| 380 // Tracks any data related or parse errors. | 380 // Tracks any data related or parse errors. |
| 381 bool bad_message_; | 381 bool bad_message_; |
| 382 | 382 |
| 383 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); | 383 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); |
| 384 }; | 384 }; |
| 385 | 385 |
| 386 } // namespace extensions | 386 } // namespace extensions |
| 387 | 387 |
| 388 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ | 388 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ |
| OLD | NEW |