OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/extensions/api/webview/webview_api.h" | 5 #include "chrome/browser/extensions/api/webview/webview_api.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | 7 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" |
8 #include "chrome/browser/extensions/tab_helper.h" | 8 #include "chrome/browser/extensions/tab_helper.h" |
9 #include "chrome/browser/guestview/webview/webview_guest.h" | 9 #include "chrome/browser/guestview/webview/webview_guest.h" |
10 #include "chrome/common/extensions/api/webview.h" | 10 #include "chrome/common/extensions/api/webview.h" |
11 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
12 #include "content/public/browser/render_view_host.h" | 12 #include "content/public/browser/render_view_host.h" |
13 #include "content/public/browser/storage_partition.h" | 13 #include "content/public/browser/storage_partition.h" |
14 #include "content/public/browser/user_metrics.h" | 14 #include "content/public/browser/user_metrics.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "extensions/common/error_utils.h" | 16 #include "extensions/common/error_utils.h" |
17 | 17 |
18 using extensions::api::tabs::InjectDetails; | 18 using extensions::api::tabs::InjectDetails; |
19 namespace webview = extensions::api::webview; | 19 namespace webview = extensions::api::webview; |
20 | 20 |
| 21 namespace extensions { |
| 22 |
21 namespace { | 23 namespace { |
22 int MaskForKey(const char* key) { | 24 int MaskForKey(const char* key) { |
23 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) | 25 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) |
24 return content::StoragePartition::REMOVE_DATA_MASK_APPCACHE; | 26 return content::StoragePartition::REMOVE_DATA_MASK_APPCACHE; |
25 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) | 27 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) |
26 return content::StoragePartition::REMOVE_DATA_MASK_COOKIES; | 28 return content::StoragePartition::REMOVE_DATA_MASK_COOKIES; |
27 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) | 29 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) |
28 return content::StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS; | 30 return content::StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS; |
29 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) | 31 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) |
30 return content::StoragePartition::REMOVE_DATA_MASK_INDEXEDDB; | 32 return content::StoragePartition::REMOVE_DATA_MASK_INDEXEDDB; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 EXTENSION_FUNCTION_VALIDATE(params.get()); | 303 EXTENSION_FUNCTION_VALIDATE(params.get()); |
302 | 304 |
303 WebViewGuest* guest = WebViewGuest::From( | 305 WebViewGuest* guest = WebViewGuest::From( |
304 render_view_host()->GetProcess()->GetID(), params->instance_id); | 306 render_view_host()->GetProcess()->GetID(), params->instance_id); |
305 if (!guest) | 307 if (!guest) |
306 return false; | 308 return false; |
307 | 309 |
308 guest->Terminate(); | 310 guest->Terminate(); |
309 return true; | 311 return true; |
310 } | 312 } |
| 313 |
| 314 } // namespace extensions |
OLD | NEW |