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 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" | 5 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 using zoom::ZoomController; | 37 using zoom::ZoomController; |
38 // error messages for content scripts: | 38 // error messages for content scripts: |
39 namespace errors = extensions::manifest_errors; | 39 namespace errors = extensions::manifest_errors; |
40 namespace web_view_internal = extensions::api::web_view_internal; | 40 namespace web_view_internal = extensions::api::web_view_internal; |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 const char kAppCacheKey[] = "appcache"; | 44 const char kAppCacheKey[] = "appcache"; |
45 const char kCacheKey[] = "cache"; | 45 const char kCacheKey[] = "cache"; |
46 const char kCookiesKey[] = "cookies"; | 46 const char kCookiesKey[] = "cookies"; |
| 47 const char kSessionCookiesKey[] = "sessionCookies"; |
| 48 const char kPersistentCookiesKey[] = "persistentCookies"; |
47 const char kFileSystemsKey[] = "fileSystems"; | 49 const char kFileSystemsKey[] = "fileSystems"; |
48 const char kIndexedDBKey[] = "indexedDB"; | 50 const char kIndexedDBKey[] = "indexedDB"; |
49 const char kLocalStorageKey[] = "localStorage"; | 51 const char kLocalStorageKey[] = "localStorage"; |
50 const char kWebSQLKey[] = "webSQL"; | 52 const char kWebSQLKey[] = "webSQL"; |
51 const char kSinceKey[] = "since"; | 53 const char kSinceKey[] = "since"; |
52 const char kLoadFileError[] = "Failed to load file: \"*\". "; | 54 const char kLoadFileError[] = "Failed to load file: \"*\". "; |
53 const char kViewInstanceIdError[] = "view_instance_id is missing."; | 55 const char kViewInstanceIdError[] = "view_instance_id is missing."; |
54 const char kDuplicatedContentScriptNamesError[] = | 56 const char kDuplicatedContentScriptNamesError[] = |
55 "The given content script name already exists."; | 57 "The given content script name already exists."; |
56 | 58 |
57 const char kGeneratedScriptFilePrefix[] = "generated_script_file:"; | 59 const char kGeneratedScriptFilePrefix[] = "generated_script_file:"; |
58 | 60 |
59 uint32_t MaskForKey(const char* key) { | 61 uint32_t MaskForKey(const char* key) { |
60 if (strcmp(key, kAppCacheKey) == 0) | 62 if (strcmp(key, kAppCacheKey) == 0) |
61 return webview::WEB_VIEW_REMOVE_DATA_MASK_APPCACHE; | 63 return webview::WEB_VIEW_REMOVE_DATA_MASK_APPCACHE; |
62 if (strcmp(key, kCacheKey) == 0) | 64 if (strcmp(key, kCacheKey) == 0) |
63 return webview::WEB_VIEW_REMOVE_DATA_MASK_CACHE; | 65 return webview::WEB_VIEW_REMOVE_DATA_MASK_CACHE; |
| 66 if (strcmp(key, kSessionCookiesKey) == 0) |
| 67 return webview::WEB_VIEW_REMOVE_DATA_MASK_SESSION_COOKIES; |
| 68 if (strcmp(key, kPersistentCookiesKey) == 0) |
| 69 return webview::WEB_VIEW_REMOVE_DATA_MASK_PERSISTENT_COOKIES; |
64 if (strcmp(key, kCookiesKey) == 0) | 70 if (strcmp(key, kCookiesKey) == 0) |
65 return webview::WEB_VIEW_REMOVE_DATA_MASK_COOKIES; | 71 return webview::WEB_VIEW_REMOVE_DATA_MASK_COOKIES; |
66 if (strcmp(key, kFileSystemsKey) == 0) | 72 if (strcmp(key, kFileSystemsKey) == 0) |
67 return webview::WEB_VIEW_REMOVE_DATA_MASK_FILE_SYSTEMS; | 73 return webview::WEB_VIEW_REMOVE_DATA_MASK_FILE_SYSTEMS; |
68 if (strcmp(key, kIndexedDBKey) == 0) | 74 if (strcmp(key, kIndexedDBKey) == 0) |
69 return webview::WEB_VIEW_REMOVE_DATA_MASK_INDEXEDDB; | 75 return webview::WEB_VIEW_REMOVE_DATA_MASK_INDEXEDDB; |
70 if (strcmp(key, kLocalStorageKey) == 0) | 76 if (strcmp(key, kLocalStorageKey) == 0) |
71 return webview::WEB_VIEW_REMOVE_DATA_MASK_LOCAL_STORAGE; | 77 return webview::WEB_VIEW_REMOVE_DATA_MASK_LOCAL_STORAGE; |
72 if (strcmp(key, kWebSQLKey) == 0) | 78 if (strcmp(key, kWebSQLKey) == 0) |
73 return webview::WEB_VIEW_REMOVE_DATA_MASK_WEBSQL; | 79 return webview::WEB_VIEW_REMOVE_DATA_MASK_WEBSQL; |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 // Will finish asynchronously. | 981 // Will finish asynchronously. |
976 return true; | 982 return true; |
977 } | 983 } |
978 | 984 |
979 void WebViewInternalClearDataFunction::ClearDataDone() { | 985 void WebViewInternalClearDataFunction::ClearDataDone() { |
980 Release(); // Balanced in RunAsync(). | 986 Release(); // Balanced in RunAsync(). |
981 SendResponse(true); | 987 SendResponse(true); |
982 } | 988 } |
983 | 989 |
984 } // namespace extensions | 990 } // namespace extensions |
OLD | NEW |