| 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_content/content_action.h" | 5 #include "chrome/browser/extensions/api/declarative_content/content_action.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/extensions/api/declarative_content/content_constants.h" | 12 #include "chrome/browser/extensions/api/declarative_content/content_constants.h" |
| 13 #include "chrome/browser/extensions/extension_action.h" | 13 #include "chrome/browser/extensions/extension_action.h" |
| 14 #include "chrome/browser/extensions/extension_action_manager.h" | 14 #include "chrome/browser/extensions/extension_action_manager.h" |
| 15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/extensions/extension_system.h" | 16 #include "chrome/browser/extensions/extension_system.h" |
| 17 #include "chrome/browser/extensions/extension_tab_util.h" | 17 #include "chrome/browser/extensions/extension_tab_util.h" |
| 18 #include "chrome/common/extensions/extension.h" | |
| 19 #include "content/public/browser/invalidate_type.h" | 18 #include "content/public/browser/invalidate_type.h" |
| 20 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "extensions/common/extension.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 namespace keys = declarative_content_constants; | 24 namespace keys = declarative_content_constants; |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 // Error messages. | 27 // Error messages. |
| 28 const char kInvalidInstanceTypeError[] = | 28 const char kInvalidInstanceTypeError[] = |
| 29 "An action has an invalid instanceType: %s"; | 29 "An action has an invalid instanceType: %s"; |
| 30 const char kNoPageAction[] = | 30 const char kNoPageAction[] = |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 factory_method_iter = factory.factory_methods.find(instance_type); | 150 factory_method_iter = factory.factory_methods.find(instance_type); |
| 151 if (factory_method_iter != factory.factory_methods.end()) | 151 if (factory_method_iter != factory.factory_methods.end()) |
| 152 return (*factory_method_iter->second)( | 152 return (*factory_method_iter->second)( |
| 153 extension, action_dict, error, bad_message); | 153 extension, action_dict, error, bad_message); |
| 154 | 154 |
| 155 *error = base::StringPrintf(kInvalidInstanceTypeError, instance_type.c_str()); | 155 *error = base::StringPrintf(kInvalidInstanceTypeError, instance_type.c_str()); |
| 156 return scoped_refptr<ContentAction>(); | 156 return scoped_refptr<ContentAction>(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace extensions | 159 } // namespace extensions |
| OLD | NEW |