Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "modules/extensions/DeveloperPrivate.h" | |
| 6 | |
| 7 #include "core/dom/StringCallback.h" | |
| 8 #include "core/frame/LocalFrame.h" | |
| 9 #include "core/html/VoidCallback.h" | |
| 10 #include "modules/extensions/ExtensionInfo.h" | |
| 11 #include "modules/extensions/UpdateExtensionConfigurationParams.h" | |
| 12 #include "platform/UserGestureIndicator.h" | |
| 13 #include "platform/heap/Visitor.h" | |
| 14 #include "platform/mojo/MojoHelper.h" | |
| 15 #include "public/platform/ServiceRegistry.h" | |
| 16 | |
| 17 namespace blink { | |
| 18 | |
| 19 DeveloperPrivate::DeveloperPrivate(LocalFrame* frame) | |
|
Devlin
2016/06/18 01:24:59
Ideally, since all this file does is forward to a
| |
| 20 { | |
| 21 frame->serviceRegistry()->connectToRemoteService(mojo::GetProxy(&m_developer Private)); | |
| 22 } | |
| 23 | |
| 24 DEFINE_TRACE(DeveloperPrivate) | |
| 25 { | |
| 26 } | |
| 27 | |
| 28 void DeveloperPrivate::updateExtensionConfiguration( | |
| 29 UpdateExtensionConfigurationParams& params, | |
| 30 VoidCallback* callback) | |
| 31 { | |
| 32 extensions::mojom::blink::UpdateExtensionConfigurationParamsPtr mojoParams( | |
| 33 extensions::mojom::blink::UpdateExtensionConfigurationParams::New()); | |
| 34 mojoParams->extension_id = params.extensionId(); | |
| 35 mojoParams->has_file_access = params.hasFileAccess(); | |
| 36 mojoParams->file_access = params.hasFileAccess() && params.fileAccess(); | |
| 37 mojoParams->has_incognito_access = params.hasIncognitoAccess(); | |
| 38 mojoParams->incognito_access = params.hasIncognitoAccess() && params.incogni toAccess(); | |
| 39 mojoParams->has_error_collection = params.hasErrorCollection(); | |
| 40 mojoParams->error_collection = params.hasErrorCollection() && params.errorCo llection(); | |
| 41 mojoParams->has_run_on_all_urls = params.hasRunOnAllUrls(); | |
| 42 mojoParams->run_on_all_urls = params.hasRunOnAllUrls() && params.runOnAllUrl s(); | |
| 43 mojoParams->has_show_action_button = params.hasShowActionButton(); | |
| 44 mojoParams->show_action_button = params.hasShowActionButton() && params.show ActionButton(); | |
| 45 | |
| 46 m_developerPrivate->UpdateExtensionConfiguration( | |
| 47 UserGestureIndicator::processingUserGesture(), | |
| 48 std::move(mojoParams), | |
| 49 createBaseCallback(bind(&DeveloperPrivate::onUpdateExtensionConfiguratio nCallback, this, callback))); | |
| 50 } | |
| 51 | |
| 52 void DeveloperPrivate::onUpdateExtensionConfigurationCallback(VoidCallback* call back) | |
| 53 { | |
| 54 callback->handleEvent(); | |
| 55 } | |
| 56 | |
| 57 } // namespace blink | |
| OLD | NEW |