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

Side by Side Diff: chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc

Issue 847333004: Move parts from enterprise.platformKeysInternal to platformKeysInternal for reuse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_idl
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/chrome_extensions_dispatcher_delegate.h" 5 #include "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/chrome_version_info.h" 11 #include "chrome/common/chrome_version_info.h"
12 #include "chrome/common/crash_keys.h" 12 #include "chrome/common/crash_keys.h"
13 #include "chrome/common/extensions/features/feature_channel.h" 13 #include "chrome/common/extensions/features/feature_channel.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "chrome/grit/renderer_resources.h" 15 #include "chrome/grit/renderer_resources.h"
16 #include "chrome/renderer/extensions/app_bindings.h" 16 #include "chrome/renderer/extensions/app_bindings.h"
17 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h" 17 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h"
18 #include "chrome/renderer/extensions/chrome_v8_context.h" 18 #include "chrome/renderer/extensions/chrome_v8_context.h"
19 #include "chrome/renderer/extensions/enterprise_platform_keys_natives.h"
20 #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h" 19 #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h"
21 #include "chrome/renderer/extensions/file_manager_private_custom_bindings.h" 20 #include "chrome/renderer/extensions/file_manager_private_custom_bindings.h"
22 #include "chrome/renderer/extensions/media_galleries_custom_bindings.h" 21 #include "chrome/renderer/extensions/media_galleries_custom_bindings.h"
23 #include "chrome/renderer/extensions/notifications_native_handler.h" 22 #include "chrome/renderer/extensions/notifications_native_handler.h"
24 #include "chrome/renderer/extensions/page_capture_custom_bindings.h" 23 #include "chrome/renderer/extensions/page_capture_custom_bindings.h"
24 #include "chrome/renderer/extensions/platform_keys_natives.h"
25 #include "chrome/renderer/extensions/sync_file_system_custom_bindings.h" 25 #include "chrome/renderer/extensions/sync_file_system_custom_bindings.h"
26 #include "chrome/renderer/extensions/tab_finder.h" 26 #include "chrome/renderer/extensions/tab_finder.h"
27 #include "chrome/renderer/extensions/tabs_custom_bindings.h" 27 #include "chrome/renderer/extensions/tabs_custom_bindings.h"
28 #include "chrome/renderer/extensions/webstore_bindings.h" 28 #include "chrome/renderer/extensions/webstore_bindings.h"
29 #include "content/public/renderer/render_thread.h" 29 #include "content/public/renderer/render_thread.h"
30 #include "content/public/renderer/render_view.h" 30 #include "content/public/renderer/render_view.h"
31 #include "extensions/common/extension.h" 31 #include "extensions/common/extension.h"
32 #include "extensions/common/feature_switch.h" 32 #include "extensions/common/feature_switch.h"
33 #include "extensions/common/permissions/manifest_permission_set.h" 33 #include "extensions/common/permissions/manifest_permission_set.h"
34 #include "extensions/common/permissions/permission_set.h" 34 #include "extensions/common/permissions/permission_set.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 extensions::ScriptContext* context) { 90 extensions::ScriptContext* context) {
91 module_system->RegisterNativeHandler( 91 module_system->RegisterNativeHandler(
92 "app", 92 "app",
93 scoped_ptr<NativeHandler>( 93 scoped_ptr<NativeHandler>(
94 new extensions::AppBindings(dispatcher, context))); 94 new extensions::AppBindings(dispatcher, context)));
95 module_system->RegisterNativeHandler( 95 module_system->RegisterNativeHandler(
96 "sync_file_system", 96 "sync_file_system",
97 scoped_ptr<NativeHandler>( 97 scoped_ptr<NativeHandler>(
98 new extensions::SyncFileSystemCustomBindings(context))); 98 new extensions::SyncFileSystemCustomBindings(context)));
99 module_system->RegisterNativeHandler( 99 module_system->RegisterNativeHandler(
100 "enterprise_platform_keys_natives",
101 scoped_ptr<NativeHandler>(
102 new extensions::EnterprisePlatformKeysNatives(context)));
103 module_system->RegisterNativeHandler(
104 "file_browser_handler", 100 "file_browser_handler",
105 scoped_ptr<NativeHandler>( 101 scoped_ptr<NativeHandler>(
106 new extensions::FileBrowserHandlerCustomBindings(context))); 102 new extensions::FileBrowserHandlerCustomBindings(context)));
107 module_system->RegisterNativeHandler( 103 module_system->RegisterNativeHandler(
108 "file_manager_private", 104 "file_manager_private",
109 scoped_ptr<NativeHandler>( 105 scoped_ptr<NativeHandler>(
110 new extensions::FileManagerPrivateCustomBindings(context))); 106 new extensions::FileManagerPrivateCustomBindings(context)));
111 module_system->RegisterNativeHandler( 107 module_system->RegisterNativeHandler(
112 "notifications_private", 108 "notifications_private",
113 scoped_ptr<NativeHandler>( 109 scoped_ptr<NativeHandler>(
114 new extensions::NotificationsNativeHandler(context))); 110 new extensions::NotificationsNativeHandler(context)));
115 module_system->RegisterNativeHandler( 111 module_system->RegisterNativeHandler(
116 "mediaGalleries", 112 "mediaGalleries",
117 scoped_ptr<NativeHandler>( 113 scoped_ptr<NativeHandler>(
118 new extensions::MediaGalleriesCustomBindings(context))); 114 new extensions::MediaGalleriesCustomBindings(context)));
119 module_system->RegisterNativeHandler( 115 module_system->RegisterNativeHandler(
120 "page_capture", 116 "page_capture",
121 scoped_ptr<NativeHandler>( 117 scoped_ptr<NativeHandler>(
122 new extensions::PageCaptureCustomBindings(context))); 118 new extensions::PageCaptureCustomBindings(context)));
123 module_system->RegisterNativeHandler( 119 module_system->RegisterNativeHandler(
120 "platform_keys_natives",
121 scoped_ptr<NativeHandler>(new extensions::PlatformKeysNatives(context)));
122 module_system->RegisterNativeHandler(
124 "tabs", 123 "tabs",
125 scoped_ptr<NativeHandler>(new extensions::TabsCustomBindings(context))); 124 scoped_ptr<NativeHandler>(new extensions::TabsCustomBindings(context)));
126 module_system->RegisterNativeHandler( 125 module_system->RegisterNativeHandler(
127 "webstore", 126 "webstore",
128 scoped_ptr<NativeHandler>(new extensions::WebstoreBindings(context))); 127 scoped_ptr<NativeHandler>(new extensions::WebstoreBindings(context)));
129 #if defined(ENABLE_WEBRTC) 128 #if defined(ENABLE_WEBRTC)
130 module_system->RegisterNativeHandler( 129 module_system->RegisterNativeHandler(
131 "cast_streaming_natives", 130 "cast_streaming_natives",
132 scoped_ptr<NativeHandler>( 131 scoped_ptr<NativeHandler>(
133 new extensions::CastStreamingNativeHandler(context))); 132 new extensions::CastStreamingNativeHandler(context)));
(...skipping 17 matching lines...) Expand all
151 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS); 150 IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS);
152 source_map->RegisterSource("desktopCapture", 151 source_map->RegisterSource("desktopCapture",
153 IDR_DESKTOP_CAPTURE_CUSTOM_BINDINGS_JS); 152 IDR_DESKTOP_CAPTURE_CUSTOM_BINDINGS_JS);
154 source_map->RegisterSource("developerPrivate", 153 source_map->RegisterSource("developerPrivate",
155 IDR_DEVELOPER_PRIVATE_CUSTOM_BINDINGS_JS); 154 IDR_DEVELOPER_PRIVATE_CUSTOM_BINDINGS_JS);
156 source_map->RegisterSource("downloads", IDR_DOWNLOADS_CUSTOM_BINDINGS_JS); 155 source_map->RegisterSource("downloads", IDR_DOWNLOADS_CUSTOM_BINDINGS_JS);
157 source_map->RegisterSource("enterprise.platformKeys", 156 source_map->RegisterSource("enterprise.platformKeys",
158 IDR_ENTERPRISE_PLATFORM_KEYS_CUSTOM_BINDINGS_JS); 157 IDR_ENTERPRISE_PLATFORM_KEYS_CUSTOM_BINDINGS_JS);
159 source_map->RegisterSource("enterprise.platformKeys.internalAPI", 158 source_map->RegisterSource("enterprise.platformKeys.internalAPI",
160 IDR_ENTERPRISE_PLATFORM_KEYS_INTERNAL_API_JS); 159 IDR_ENTERPRISE_PLATFORM_KEYS_INTERNAL_API_JS);
161 source_map->RegisterSource("enterprise.platformKeys.Key",
162 IDR_ENTERPRISE_PLATFORM_KEYS_KEY_JS);
163 source_map->RegisterSource("enterprise.platformKeys.KeyPair", 160 source_map->RegisterSource("enterprise.platformKeys.KeyPair",
164 IDR_ENTERPRISE_PLATFORM_KEYS_KEY_PAIR_JS); 161 IDR_ENTERPRISE_PLATFORM_KEYS_KEY_PAIR_JS);
165 source_map->RegisterSource("enterprise.platformKeys.SubtleCrypto", 162 source_map->RegisterSource("enterprise.platformKeys.SubtleCrypto",
166 IDR_ENTERPRISE_PLATFORM_KEYS_SUBTLE_CRYPTO_JS); 163 IDR_ENTERPRISE_PLATFORM_KEYS_SUBTLE_CRYPTO_JS);
167 source_map->RegisterSource("enterprise.platformKeys.Token", 164 source_map->RegisterSource("enterprise.platformKeys.Token",
168 IDR_ENTERPRISE_PLATFORM_KEYS_TOKEN_JS); 165 IDR_ENTERPRISE_PLATFORM_KEYS_TOKEN_JS);
169 source_map->RegisterSource("enterprise.platformKeys.utils",
170 IDR_ENTERPRISE_PLATFORM_KEYS_UTILS_JS);
171 source_map->RegisterSource("feedbackPrivate", 166 source_map->RegisterSource("feedbackPrivate",
172 IDR_FEEDBACK_PRIVATE_CUSTOM_BINDINGS_JS); 167 IDR_FEEDBACK_PRIVATE_CUSTOM_BINDINGS_JS);
173 source_map->RegisterSource("fileBrowserHandler", 168 source_map->RegisterSource("fileBrowserHandler",
174 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS); 169 IDR_FILE_BROWSER_HANDLER_CUSTOM_BINDINGS_JS);
175 source_map->RegisterSource("fileManagerPrivate", 170 source_map->RegisterSource("fileManagerPrivate",
176 IDR_FILE_MANAGER_PRIVATE_CUSTOM_BINDINGS_JS); 171 IDR_FILE_MANAGER_PRIVATE_CUSTOM_BINDINGS_JS);
177 source_map->RegisterSource("fileSystem", IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS); 172 source_map->RegisterSource("fileSystem", IDR_FILE_SYSTEM_CUSTOM_BINDINGS_JS);
178 source_map->RegisterSource("fileSystemProvider", 173 source_map->RegisterSource("fileSystemProvider",
179 IDR_FILE_SYSTEM_PROVIDER_CUSTOM_BINDINGS_JS); 174 IDR_FILE_SYSTEM_PROVIDER_CUSTOM_BINDINGS_JS);
180 source_map->RegisterSource("gcm", IDR_GCM_CUSTOM_BINDINGS_JS); 175 source_map->RegisterSource("gcm", IDR_GCM_CUSTOM_BINDINGS_JS);
181 source_map->RegisterSource("identity", IDR_IDENTITY_CUSTOM_BINDINGS_JS); 176 source_map->RegisterSource("identity", IDR_IDENTITY_CUSTOM_BINDINGS_JS);
182 source_map->RegisterSource("imageWriterPrivate", 177 source_map->RegisterSource("imageWriterPrivate",
183 IDR_IMAGE_WRITER_PRIVATE_CUSTOM_BINDINGS_JS); 178 IDR_IMAGE_WRITER_PRIVATE_CUSTOM_BINDINGS_JS);
184 source_map->RegisterSource("input.ime", IDR_INPUT_IME_CUSTOM_BINDINGS_JS); 179 source_map->RegisterSource("input.ime", IDR_INPUT_IME_CUSTOM_BINDINGS_JS);
185 source_map->RegisterSource("logPrivate", IDR_LOG_PRIVATE_CUSTOM_BINDINGS_JS); 180 source_map->RegisterSource("logPrivate", IDR_LOG_PRIVATE_CUSTOM_BINDINGS_JS);
186 source_map->RegisterSource("mediaGalleries", 181 source_map->RegisterSource("mediaGalleries",
187 IDR_MEDIA_GALLERIES_CUSTOM_BINDINGS_JS); 182 IDR_MEDIA_GALLERIES_CUSTOM_BINDINGS_JS);
188 source_map->RegisterSource("notifications", 183 source_map->RegisterSource("notifications",
189 IDR_NOTIFICATIONS_CUSTOM_BINDINGS_JS); 184 IDR_NOTIFICATIONS_CUSTOM_BINDINGS_JS);
190 source_map->RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS); 185 source_map->RegisterSource("omnibox", IDR_OMNIBOX_CUSTOM_BINDINGS_JS);
191 source_map->RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); 186 source_map->RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS);
192 source_map->RegisterSource("pageCapture", 187 source_map->RegisterSource("pageCapture",
193 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); 188 IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS);
189 source_map->RegisterSource("platformKeys.internalAPI",
190 IDR_PLATFORM_KEYS_INTERNAL_API_JS);
191 source_map->RegisterSource("platformKeys.Key", IDR_PLATFORM_KEYS_KEY_JS);
192 source_map->RegisterSource("platformKeys.SubtleCrypto",
193 IDR_PLATFORM_KEYS_SUBTLE_CRYPTO_JS);
194 source_map->RegisterSource("platformKeys.utils", IDR_PLATFORM_KEYS_UTILS_JS);
194 source_map->RegisterSource("syncFileSystem", 195 source_map->RegisterSource("syncFileSystem",
195 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS); 196 IDR_SYNC_FILE_SYSTEM_CUSTOM_BINDINGS_JS);
196 source_map->RegisterSource("systemIndicator", 197 source_map->RegisterSource("systemIndicator",
197 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS); 198 IDR_SYSTEM_INDICATOR_CUSTOM_BINDINGS_JS);
198 source_map->RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS); 199 source_map->RegisterSource("tabCapture", IDR_TAB_CAPTURE_CUSTOM_BINDINGS_JS);
199 source_map->RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); 200 source_map->RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS);
200 source_map->RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); 201 source_map->RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS);
201 source_map->RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); 202 source_map->RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS);
202 #if defined(ENABLE_WEBRTC) 203 #if defined(ENABLE_WEBRTC)
203 source_map->RegisterSource("cast.streaming.rtpStream", 204 source_map->RegisterSource("cast.streaming.rtpStream",
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 270 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
270 ::switches::kSingleProcess)) 271 ::switches::kSingleProcess))
271 return; 272 return;
272 crash_keys::SetActiveExtensions(extension_ids); 273 crash_keys::SetActiveExtensions(extension_ids);
273 } 274 }
274 275
275 void ChromeExtensionsDispatcherDelegate::SetChannel(int channel) { 276 void ChromeExtensionsDispatcherDelegate::SetChannel(int channel) {
276 extensions::SetCurrentChannel( 277 extensions::SetCurrentChannel(
277 static_cast<chrome::VersionInfo::Channel>(channel)); 278 static_cast<chrome::VersionInfo::Channel>(channel));
278 } 279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698