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" | |
17 #include "chrome/browser/extensions/extension_tab_util.h" | 16 #include "chrome/browser/extensions/extension_tab_util.h" |
| 17 #include "chrome/browser/profiles/profile.h" |
18 #include "content/public/browser/invalidate_type.h" | 18 #include "content/public/browser/invalidate_type.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "extensions/browser/extension_system.h" |
20 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
21 | 22 |
22 namespace extensions { | 23 namespace extensions { |
23 | 24 |
24 namespace keys = declarative_content_constants; | 25 namespace keys = declarative_content_constants; |
25 | 26 |
26 namespace { | 27 namespace { |
27 // Error messages. | 28 // Error messages. |
28 const char kInvalidInstanceTypeError[] = | 29 const char kInvalidInstanceTypeError[] = |
29 "An action has an invalid instanceType: %s"; | 30 "An action has an invalid instanceType: %s"; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 factory_method_iter = factory.factory_methods.find(instance_type); | 151 factory_method_iter = factory.factory_methods.find(instance_type); |
151 if (factory_method_iter != factory.factory_methods.end()) | 152 if (factory_method_iter != factory.factory_methods.end()) |
152 return (*factory_method_iter->second)( | 153 return (*factory_method_iter->second)( |
153 extension, action_dict, error, bad_message); | 154 extension, action_dict, error, bad_message); |
154 | 155 |
155 *error = base::StringPrintf(kInvalidInstanceTypeError, instance_type.c_str()); | 156 *error = base::StringPrintf(kInvalidInstanceTypeError, instance_type.c_str()); |
156 return scoped_refptr<ContentAction>(); | 157 return scoped_refptr<ContentAction>(); |
157 } | 158 } |
158 | 159 |
159 } // namespace extensions | 160 } // namespace extensions |
OLD | NEW |