| 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/api/declarative/rules_registry.h" | 5 #include "chrome/browser/extensions/api/declarative/rules_registry.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
| 15 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" | 15 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" |
| 16 #include "chrome/browser/extensions/extension_prefs.h" | 16 #include "chrome/browser/extensions/extension_prefs.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/extensions/extension_system.h" | 18 #include "chrome/browser/extensions/extension_system.h" |
| 19 #include "chrome/browser/extensions/extension_util.h" | 19 #include "chrome/browser/extensions/extension_util.h" |
| 20 #include "chrome/browser/extensions/state_store.h" | 20 #include "chrome/browser/extensions/state_store.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/common/extensions/extension.h" | |
| 23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/notification_details.h" | 23 #include "content/public/browser/notification_details.h" |
| 25 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
| 25 #include "extensions/common/extension.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 const char kSuccess[] = ""; | 29 const char kSuccess[] = ""; |
| 30 const char kDuplicateRuleId[] = "Duplicate rule ID: %s"; | 30 const char kDuplicateRuleId[] = "Duplicate rule ID: %s"; |
| 31 | 31 |
| 32 scoped_ptr<base::Value> RulesToValue( | 32 scoped_ptr<base::Value> RulesToValue( |
| 33 const std::vector<linked_ptr<extensions::RulesRegistry::Rule> >& rules) { | 33 const std::vector<linked_ptr<extensions::RulesRegistry::Rule> >& rules) { |
| 34 scoped_ptr<base::ListValue> list(new base::ListValue()); | 34 scoped_ptr<base::ListValue> list(new base::ListValue()); |
| 35 for (size_t i = 0; i < rules.size(); ++i) | 35 for (size_t i = 0; i < rules.size(); ++i) |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 for (i = identifiers.begin(); i != identifiers.end(); ++i) | 350 for (i = identifiers.begin(); i != identifiers.end(); ++i) |
| 351 used_rule_identifiers_[extension_id].erase(*i); | 351 used_rule_identifiers_[extension_id].erase(*i); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void RulesRegistry::RemoveAllUsedRuleIdentifiers( | 354 void RulesRegistry::RemoveAllUsedRuleIdentifiers( |
| 355 const std::string& extension_id) { | 355 const std::string& extension_id) { |
| 356 used_rule_identifiers_.erase(extension_id); | 356 used_rule_identifiers_.erase(extension_id); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace extensions | 359 } // namespace extensions |
| OLD | NEW |