| 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 // Defines the Chrome Extensions BrowsingData API functions, which entail | 5 // Defines the Chrome Extensions BrowsingData API functions, which entail |
| 6 // clearing browsing data, and clearing the browser's cache (which, let's be | 6 // clearing browsing data, and clearing the browser's cache (which, let's be |
| 7 // honest, are the same thing), as specified in the extension API JSON. | 7 // honest, are the same thing), as specified in the extension API JSON. |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | 9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 extension_browsing_data_api_constants::kProtectedWebKey, | 138 extension_browsing_data_api_constants::kProtectedWebKey, |
| 139 prefs_->GetBoolean(browsing_data::prefs::kDeleteHostedAppsData)); | 139 prefs_->GetBoolean(browsing_data::prefs::kDeleteHostedAppsData)); |
| 140 origin_types->SetBoolean( | 140 origin_types->SetBoolean( |
| 141 extension_browsing_data_api_constants::kExtensionsKey, false); | 141 extension_browsing_data_api_constants::kExtensionsKey, false); |
| 142 | 142 |
| 143 // Fill deletion time period. | 143 // Fill deletion time period. |
| 144 int period_pref = prefs_->GetInteger(browsing_data::prefs::kDeleteTimePeriod); | 144 int period_pref = prefs_->GetInteger(browsing_data::prefs::kDeleteTimePeriod); |
| 145 browsing_data::TimePeriod period = | 145 browsing_data::TimePeriod period = |
| 146 static_cast<browsing_data::TimePeriod>(period_pref); | 146 static_cast<browsing_data::TimePeriod>(period_pref); |
| 147 double since = 0; | 147 double since = 0; |
| 148 if (period != browsing_data::ALL_TIME) { | 148 if (period != browsing_data::TimePeriod::ALL_TIME) { |
| 149 base::Time time = browsing_data::CalculateBeginDeleteTime(period); | 149 base::Time time = browsing_data::CalculateBeginDeleteTime(period); |
| 150 since = time.ToJsTime(); | 150 since = time.ToJsTime(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue); | 153 std::unique_ptr<base::DictionaryValue> options(new base::DictionaryValue); |
| 154 options->Set(extension_browsing_data_api_constants::kOriginTypesKey, | 154 options->Set(extension_browsing_data_api_constants::kOriginTypesKey, |
| 155 origin_types.release()); | 155 origin_types.release()); |
| 156 options->SetDouble(extension_browsing_data_api_constants::kSinceKey, since); | 156 options->SetDouble(extension_browsing_data_api_constants::kSinceKey, since); |
| 157 | 157 |
| 158 // Fill dataToRemove and dataRemovalPermitted. | 158 // Fill dataToRemove and dataRemovalPermitted. |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 bool BrowsingDataRemoveCacheStorageFunction::GetRemovalMask(int* removal_mask) { | 462 bool BrowsingDataRemoveCacheStorageFunction::GetRemovalMask(int* removal_mask) { |
| 463 *removal_mask = BrowsingDataRemover::REMOVE_CACHE_STORAGE; | 463 *removal_mask = BrowsingDataRemover::REMOVE_CACHE_STORAGE; |
| 464 return true; | 464 return true; |
| 465 } | 465 } |
| 466 | 466 |
| 467 bool BrowsingDataRemoveWebSQLFunction::GetRemovalMask(int* removal_mask) { | 467 bool BrowsingDataRemoveWebSQLFunction::GetRemovalMask(int* removal_mask) { |
| 468 *removal_mask = BrowsingDataRemover::REMOVE_WEBSQL; | 468 *removal_mask = BrowsingDataRemover::REMOVE_WEBSQL; |
| 469 return true; | 469 return true; |
| 470 } | 470 } |
| OLD | NEW |