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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 534163002: Move app.window API implementation to extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix OWNERS Created 6 years, 3 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 "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 23 matching lines...) Expand all
34 #include "extensions/common/manifest_handlers/externally_connectable.h" 34 #include "extensions/common/manifest_handlers/externally_connectable.h"
35 #include "extensions/common/manifest_handlers/sandboxed_page_info.h" 35 #include "extensions/common/manifest_handlers/sandboxed_page_info.h"
36 #include "extensions/common/message_bundle.h" 36 #include "extensions/common/message_bundle.h"
37 #include "extensions/common/permissions/permission_set.h" 37 #include "extensions/common/permissions/permission_set.h"
38 #include "extensions/common/permissions/permissions_data.h" 38 #include "extensions/common/permissions/permissions_data.h"
39 #include "extensions/common/switches.h" 39 #include "extensions/common/switches.h"
40 #include "extensions/common/view_type.h" 40 #include "extensions/common/view_type.h"
41 #include "extensions/renderer/api_activity_logger.h" 41 #include "extensions/renderer/api_activity_logger.h"
42 #include "extensions/renderer/api_definitions_natives.h" 42 #include "extensions/renderer/api_definitions_natives.h"
43 #include "extensions/renderer/app_runtime_custom_bindings.h" 43 #include "extensions/renderer/app_runtime_custom_bindings.h"
44 #include "extensions/renderer/app_window_custom_bindings.h"
44 #include "extensions/renderer/binding_generating_native_handler.h" 45 #include "extensions/renderer/binding_generating_native_handler.h"
45 #include "extensions/renderer/blob_native_handler.h" 46 #include "extensions/renderer/blob_native_handler.h"
46 #include "extensions/renderer/content_watcher.h" 47 #include "extensions/renderer/content_watcher.h"
47 #include "extensions/renderer/context_menus_custom_bindings.h" 48 #include "extensions/renderer/context_menus_custom_bindings.h"
48 #include "extensions/renderer/css_native_handler.h" 49 #include "extensions/renderer/css_native_handler.h"
49 #include "extensions/renderer/dispatcher_delegate.h" 50 #include "extensions/renderer/dispatcher_delegate.h"
50 #include "extensions/renderer/document_custom_bindings.h" 51 #include "extensions/renderer/document_custom_bindings.h"
51 #include "extensions/renderer/dom_activity_logger.h" 52 #include "extensions/renderer/dom_activity_logger.h"
52 #include "extensions/renderer/event_bindings.h" 53 #include "extensions/renderer/event_bindings.h"
53 #include "extensions/renderer/extension_groups.h" 54 #include "extensions/renderer/extension_groups.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS)); 496 std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS));
496 resources.push_back( 497 resources.push_back(
497 std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS)); 498 std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS));
498 resources.push_back( 499 resources.push_back(
499 std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS)); 500 std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS));
500 501
501 // Custom bindings. 502 // Custom bindings.
502 resources.push_back( 503 resources.push_back(
503 std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS)); 504 std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS));
504 resources.push_back( 505 resources.push_back(
506 std::make_pair("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS));
507 resources.push_back(
505 std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS)); 508 std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS));
506 resources.push_back( 509 resources.push_back(
507 std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS)); 510 std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS));
508 resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS)); 511 resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS));
509 resources.push_back( 512 resources.push_back(
510 std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS)); 513 std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS));
511 resources.push_back( 514 resources.push_back(
512 std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS)); 515 std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS));
516 resources.push_back(std::make_pair("windowControls", IDR_WINDOW_CONTROLS_JS));
513 resources.push_back(std::make_pair("binding", IDR_BINDING_JS)); 517 resources.push_back(std::make_pair("binding", IDR_BINDING_JS));
514 518
515 // Custom types sources. 519 // Custom types sources.
516 resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS)); 520 resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS));
517 521
518 // Platform app sources that are not API-specific.. 522 // Platform app sources that are not API-specific..
519 resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS)); 523 resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS));
520 524
521 return resources; 525 return resources;
522 } 526 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 // Natives used by multiple APIs. 582 // Natives used by multiple APIs.
579 module_system->RegisterNativeHandler( 583 module_system->RegisterNativeHandler(
580 "file_system_natives", 584 "file_system_natives",
581 scoped_ptr<NativeHandler>(new FileSystemNatives(context))); 585 scoped_ptr<NativeHandler>(new FileSystemNatives(context)));
582 586
583 // Custom bindings. 587 // Custom bindings.
584 module_system->RegisterNativeHandler( 588 module_system->RegisterNativeHandler(
585 "app_runtime", 589 "app_runtime",
586 scoped_ptr<NativeHandler>(new AppRuntimeCustomBindings(context))); 590 scoped_ptr<NativeHandler>(new AppRuntimeCustomBindings(context)));
587 module_system->RegisterNativeHandler( 591 module_system->RegisterNativeHandler(
592 "app_window_natives",
593 scoped_ptr<NativeHandler>(
594 new AppWindowCustomBindings(dispatcher, context)));
595 module_system->RegisterNativeHandler(
588 "blob_natives", 596 "blob_natives",
589 scoped_ptr<NativeHandler>(new BlobNativeHandler(context))); 597 scoped_ptr<NativeHandler>(new BlobNativeHandler(context)));
590 module_system->RegisterNativeHandler( 598 module_system->RegisterNativeHandler(
591 "context_menus", 599 "context_menus",
592 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings(context))); 600 scoped_ptr<NativeHandler>(new ContextMenusCustomBindings(context)));
593 module_system->RegisterNativeHandler( 601 module_system->RegisterNativeHandler(
594 "css_natives", scoped_ptr<NativeHandler>(new CssNativeHandler(context))); 602 "css_natives", scoped_ptr<NativeHandler>(new CssNativeHandler(context)));
595 module_system->RegisterNativeHandler( 603 module_system->RegisterNativeHandler(
596 "document_natives", 604 "document_natives",
597 scoped_ptr<NativeHandler>(new DocumentCustomBindings(context))); 605 scoped_ptr<NativeHandler>(new DocumentCustomBindings(context)));
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 return v8::Handle<v8::Object>(); 1308 return v8::Handle<v8::Object>();
1301 1309
1302 if (bind_name) 1310 if (bind_name)
1303 *bind_name = split.back(); 1311 *bind_name = split.back();
1304 1312
1305 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1313 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1306 : bind_object; 1314 : bind_object;
1307 } 1315 }
1308 1316
1309 } // namespace extensions 1317 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/app_window_custom_bindings.cc ('k') | extensions/renderer/resources/app_window_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698