| 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 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 5 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 using content::BrowserThread; | 22 using content::BrowserThread; |
| 23 using extensions::APIPermission; | 23 using extensions::APIPermission; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Does the specified extension support the passed Web Intent, |action|? | 27 // Does the specified extension support the passed Web Intent, |action|? |
| 28 bool ExtensionSupportsIntentAction( | 28 bool ExtensionSupportsIntentAction( |
| 29 const extensions::Extension* extension, | 29 const extensions::Extension* extension, |
| 30 const std::string& action) { | 30 const std::string& action) { |
| 31 #if defined(ENABLE_WEB_INTENTS) |
| 31 for (std::vector<webkit_glue::WebIntentServiceData>::const_iterator i = | 32 for (std::vector<webkit_glue::WebIntentServiceData>::const_iterator i = |
| 32 extensions::WebIntentsInfo::GetIntentsServices(extension).begin(); | 33 extensions::WebIntentsInfo::GetIntentsServices(extension).begin(); |
| 33 i != extensions::WebIntentsInfo::GetIntentsServices(extension).end(); | 34 i != extensions::WebIntentsInfo::GetIntentsServices(extension).end(); |
| 34 ++i) { | 35 ++i) { |
| 35 if (UTF16ToUTF8(i->action) == action) | 36 if (UTF16ToUTF8(i->action) == action) |
| 36 return true; | 37 return true; |
| 37 } | 38 } |
| 39 #endif |
| 38 return false; | 40 return false; |
| 39 } | 41 } |
| 40 | 42 |
| 41 } // namespace | 43 } // namespace |
| 42 | 44 |
| 43 ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy( | 45 ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy( |
| 44 CookieSettings* cookie_settings) | 46 CookieSettings* cookie_settings) |
| 45 : cookie_settings_(cookie_settings) {} | 47 : cookie_settings_(cookie_settings) {} |
| 46 | 48 |
| 47 ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {} | 49 ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {} |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 235 |
| 234 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { | 236 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { |
| 235 ClearCache(); | 237 ClearCache(); |
| 236 extensions_.Clear(); | 238 extensions_.Clear(); |
| 237 } | 239 } |
| 238 | 240 |
| 239 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { | 241 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { |
| 240 STLDeleteValues(&cached_results_); | 242 STLDeleteValues(&cached_results_); |
| 241 cached_results_.clear(); | 243 cached_results_.clear(); |
| 242 } | 244 } |
| OLD | NEW |