| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_function_dispatcher.h" | 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "chrome/browser/extensions/extension_input_api.h" | 60 #include "chrome/browser/extensions/extension_input_api.h" |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 63 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
| 64 #include "chrome/browser/extensions/extension_input_ui_api.h" | 64 #include "chrome/browser/extensions/extension_input_ui_api.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 68 #include "chrome/browser/extensions/extension_file_browser_private_api.h" | 68 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
| 69 #include "chrome/browser/extensions/extension_info_private_api_chromeos.h" | 69 #include "chrome/browser/extensions/extension_info_private_api_chromeos.h" |
| 70 #include "chrome/browser/extensions/extension_mediaplayer_private_api.h" |
| 70 #endif | 71 #endif |
| 71 | 72 |
| 72 // FactoryRegistry ------------------------------------------------------------- | 73 // FactoryRegistry ------------------------------------------------------------- |
| 73 | 74 |
| 74 namespace { | 75 namespace { |
| 75 | 76 |
| 76 // Template for defining ExtensionFunctionFactory. | 77 // Template for defining ExtensionFunctionFactory. |
| 77 template<class T> | 78 template<class T> |
| 78 ExtensionFunction* NewExtensionFunction() { | 79 ExtensionFunction* NewExtensionFunction() { |
| 79 return new T(); | 80 return new T(); |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // FileBrowserPrivate functions. | 329 // FileBrowserPrivate functions. |
| 329 RegisterFunction<CancelFileDialogFunction>(); | 330 RegisterFunction<CancelFileDialogFunction>(); |
| 330 RegisterFunction<ExecuteTasksFileBrowserFunction>(); | 331 RegisterFunction<ExecuteTasksFileBrowserFunction>(); |
| 331 RegisterFunction<FileDialogStringsFunction>(); | 332 RegisterFunction<FileDialogStringsFunction>(); |
| 332 RegisterFunction<GetFileTasksFileBrowserFunction>(); | 333 RegisterFunction<GetFileTasksFileBrowserFunction>(); |
| 333 RegisterFunction<RequestLocalFileSystemFunction>(); | 334 RegisterFunction<RequestLocalFileSystemFunction>(); |
| 334 RegisterFunction<SelectFileFunction>(); | 335 RegisterFunction<SelectFileFunction>(); |
| 335 RegisterFunction<SelectFilesFunction>(); | 336 RegisterFunction<SelectFilesFunction>(); |
| 336 RegisterFunction<ViewFilesFunction>(); | 337 RegisterFunction<ViewFilesFunction>(); |
| 337 | 338 |
| 339 // Mediaplayer |
| 340 RegisterFunction<SetPlaylistPositionAndPlayMediaplayerFunction>(); |
| 341 RegisterFunction<PlaybackErrorMediaplayerFunction>(); |
| 342 RegisterFunction<GetPlaylistMediaplayerFunction>(); |
| 343 RegisterFunction<TogglePlaylistPanelMediaplayerFunction>(); |
| 344 RegisterFunction<ToggleFullscreenMediaplayerFunction>(); |
| 345 RegisterFunction<ShowPlaylistPanelMediaplayerFunction>(); |
| 338 #if defined(TOUCH_UI) | 346 #if defined(TOUCH_UI) |
| 339 // Input | 347 // Input |
| 340 RegisterFunction<SendHandwritingStrokeFunction>(); | 348 RegisterFunction<SendHandwritingStrokeFunction>(); |
| 341 RegisterFunction<CancelHandwritingStrokesFunction>(); | 349 RegisterFunction<CancelHandwritingStrokesFunction>(); |
| 342 #endif | 350 #endif |
| 343 #endif | 351 #endif |
| 344 | 352 |
| 345 // Websocket to TCP proxy. Currently noop on anything other than ChromeOS. | 353 // Websocket to TCP proxy. Currently noop on anything other than ChromeOS. |
| 346 RegisterFunction<WebSocketProxyPrivateGetPassportForTCPFunction>(); | 354 RegisterFunction<WebSocketProxyPrivateGetPassportForTCPFunction>(); |
| 347 | 355 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 std::string(), QuotaLimitHeuristic::kGenericOverQuotaError)); | 513 std::string(), QuotaLimitHeuristic::kGenericOverQuotaError)); |
| 506 } | 514 } |
| 507 } | 515 } |
| 508 | 516 |
| 509 void ExtensionFunctionDispatcher::SendAccessDenied( | 517 void ExtensionFunctionDispatcher::SendAccessDenied( |
| 510 RenderViewHost* render_view_host, int request_id) { | 518 RenderViewHost* render_view_host, int request_id) { |
| 511 render_view_host->Send(new ExtensionMsg_Response( | 519 render_view_host->Send(new ExtensionMsg_Response( |
| 512 render_view_host->routing_id(), request_id, false, std::string(), | 520 render_view_host->routing_id(), request_id, false, std::string(), |
| 513 "Access to extension API denied.")); | 521 "Access to extension API denied.")); |
| 514 } | 522 } |
| OLD | NEW |