| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
| 18 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" | 18 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" |
| 19 #include "chrome/browser/extensions/extension_prefs.h" | |
| 20 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_system.h" | 20 #include "chrome/browser/extensions/extension_system.h" |
| 22 #include "chrome/browser/extensions/extension_util.h" | 21 #include "chrome/browser/extensions/extension_util.h" |
| 23 #include "chrome/browser/extensions/state_store.h" | 22 #include "chrome/browser/extensions/state_store.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 25 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 26 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
| 27 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
| 27 #include "extensions/browser/extension_prefs.h" |
| 28 #include "extensions/common/extension.h" | 28 #include "extensions/common/extension.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const char kSuccess[] = ""; | 32 const char kSuccess[] = ""; |
| 33 const char kDuplicateRuleId[] = "Duplicate rule ID: %s"; | 33 const char kDuplicateRuleId[] = "Duplicate rule ID: %s"; |
| 34 | 34 |
| 35 scoped_ptr<base::Value> RulesToValue( | 35 scoped_ptr<base::Value> RulesToValue( |
| 36 const std::vector<linked_ptr<extensions::RulesRegistry::Rule> >& rules) { | 36 const std::vector<linked_ptr<extensions::RulesRegistry::Rule> >& rules) { |
| 37 scoped_ptr<base::ListValue> list(new base::ListValue()); | 37 scoped_ptr<base::ListValue> list(new base::ListValue()); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 for (i = identifiers.begin(); i != identifiers.end(); ++i) | 372 for (i = identifiers.begin(); i != identifiers.end(); ++i) |
| 373 used_rule_identifiers_[extension_id].erase(*i); | 373 used_rule_identifiers_[extension_id].erase(*i); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void RulesRegistry::RemoveAllUsedRuleIdentifiers( | 376 void RulesRegistry::RemoveAllUsedRuleIdentifiers( |
| 377 const std::string& extension_id) { | 377 const std::string& extension_id) { |
| 378 used_rule_identifiers_.erase(extension_id); | 378 used_rule_identifiers_.erase(extension_id); |
| 379 } | 379 } |
| 380 | 380 |
| 381 } // namespace extensions | 381 } // namespace extensions |
| OLD | NEW |