Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 12042096: Move page action manifest parsing out of Extension; the first multi-key manifest handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/common/child_process_logging.h" 16 #include "chrome/common/child_process_logging.h"
17 #include "chrome/common/chrome_content_client.h" 17 #include "chrome/common/chrome_content_client.h"
18 #include "chrome/common/chrome_paths.h" 18 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/content_settings_pattern.h" 20 #include "chrome/common/content_settings_pattern.h"
21 #include "chrome/common/extensions/api/extension_action/page_action_handler.h"
21 #include "chrome/common/extensions/extension.h" 22 #include "chrome/common/extensions/extension.h"
22 #include "chrome/common/extensions/extension_constants.h" 23 #include "chrome/common/extensions/extension_constants.h"
23 #include "chrome/common/extensions/extension_manifest_constants.h" 24 #include "chrome/common/extensions/extension_manifest_constants.h"
24 #include "chrome/common/extensions/extension_process_policy.h" 25 #include "chrome/common/extensions/extension_process_policy.h"
25 #include "chrome/common/extensions/extension_set.h" 26 #include "chrome/common/extensions/extension_set.h"
26 #include "chrome/common/extensions/manifest_handler.h" 27 #include "chrome/common/extensions/manifest_handler.h"
27 #include "chrome/common/extensions/manifest_url_handler.h" 28 #include "chrome/common/extensions/manifest_url_handler.h"
28 #include "chrome/common/extensions/web_accessible_resources_handler.h" 29 #include "chrome/common/extensions/web_accessible_resources_handler.h"
29 #include "chrome/common/external_ipc_fuzzer.h" 30 #include "chrome/common/external_ipc_fuzzer.h"
30 #include "chrome/common/localized_error.h" 31 #include "chrome/common/localized_error.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 // Explicitly register all extension ManifestHandlers needed to parse 127 // Explicitly register all extension ManifestHandlers needed to parse
127 // fields used in the renderer. 128 // fields used in the renderer.
128 void RegisterExtensionManifestHandlers() { 129 void RegisterExtensionManifestHandlers() {
129 extensions::ManifestHandler::Register( 130 extensions::ManifestHandler::Register(
130 extension_manifest_keys::kDevToolsPage, 131 extension_manifest_keys::kDevToolsPage,
131 make_linked_ptr(new extensions::DevToolsPageHandler)); 132 make_linked_ptr(new extensions::DevToolsPageHandler));
132 extensions::ManifestHandler::Register( 133 extensions::ManifestHandler::Register(
133 extension_manifest_keys::kWebAccessibleResources, 134 extension_manifest_keys::kWebAccessibleResources,
134 make_linked_ptr(new extensions::WebAccessibleResourcesHandler)); 135 make_linked_ptr(new extensions::WebAccessibleResourcesHandler));
136 linked_ptr<extensions::PageActionHandler> page_action_handler(
137 new extensions::PageActionHandler);
138 extensions::ManifestHandler::Register(
139 extension_manifest_keys::kPageAction, page_action_handler);
140 extensions::ManifestHandler::Register(
141 extension_manifest_keys::kPageActions, page_action_handler);
135 } 142 }
136 143
137 static void AppendParams(const std::vector<string16>& additional_names, 144 static void AppendParams(const std::vector<string16>& additional_names,
138 const std::vector<string16>& additional_values, 145 const std::vector<string16>& additional_values,
139 WebVector<WebString>* existing_names, 146 WebVector<WebString>* existing_names,
140 WebVector<WebString>* existing_values) { 147 WebVector<WebString>* existing_values) {
141 DCHECK(additional_names.size() == additional_values.size()); 148 DCHECK(additional_names.size() == additional_values.size());
142 DCHECK(existing_names->size() == existing_values->size()); 149 DCHECK(existing_names->size() == existing_values->size());
143 150
144 size_t existing_size = existing_names->size(); 151 size_t existing_size = existing_names->size();
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 } 1066 }
1060 1067
1061 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( 1068 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories(
1062 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { 1069 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
1063 #if defined(ENABLE_PLUGINS) 1070 #if defined(ENABLE_PLUGINS)
1064 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); 1071 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory);
1065 #endif 1072 #endif
1066 } 1073 }
1067 1074
1068 } // namespace chrome 1075 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698