Chromium Code Reviews| Index: third_party/WebKit/Source/modules/extensions/DeveloperPrivate.cpp |
| diff --git a/third_party/WebKit/Source/modules/extensions/DeveloperPrivate.cpp b/third_party/WebKit/Source/modules/extensions/DeveloperPrivate.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..88f7bcf915827b27328ecd0d4bd40f9ffdd10646 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/extensions/DeveloperPrivate.cpp |
| @@ -0,0 +1,57 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "modules/extensions/DeveloperPrivate.h" |
| + |
| +#include "core/dom/StringCallback.h" |
| +#include "core/frame/LocalFrame.h" |
| +#include "core/html/VoidCallback.h" |
| +#include "modules/extensions/ExtensionInfo.h" |
| +#include "modules/extensions/UpdateExtensionConfigurationParams.h" |
| +#include "platform/UserGestureIndicator.h" |
| +#include "platform/heap/Visitor.h" |
| +#include "platform/mojo/MojoHelper.h" |
| +#include "public/platform/ServiceRegistry.h" |
| + |
| +namespace blink { |
| + |
| +DeveloperPrivate::DeveloperPrivate(LocalFrame* frame) |
|
Devlin
2016/06/18 01:24:59
Ideally, since all this file does is forward to a
|
| +{ |
| + frame->serviceRegistry()->connectToRemoteService(mojo::GetProxy(&m_developerPrivate)); |
| +} |
| + |
| +DEFINE_TRACE(DeveloperPrivate) |
| +{ |
| +} |
| + |
| +void DeveloperPrivate::updateExtensionConfiguration( |
| + UpdateExtensionConfigurationParams& params, |
| + VoidCallback* callback) |
| +{ |
| + extensions::mojom::blink::UpdateExtensionConfigurationParamsPtr mojoParams( |
| + extensions::mojom::blink::UpdateExtensionConfigurationParams::New()); |
| + mojoParams->extension_id = params.extensionId(); |
| + mojoParams->has_file_access = params.hasFileAccess(); |
| + mojoParams->file_access = params.hasFileAccess() && params.fileAccess(); |
| + mojoParams->has_incognito_access = params.hasIncognitoAccess(); |
| + mojoParams->incognito_access = params.hasIncognitoAccess() && params.incognitoAccess(); |
| + mojoParams->has_error_collection = params.hasErrorCollection(); |
| + mojoParams->error_collection = params.hasErrorCollection() && params.errorCollection(); |
| + mojoParams->has_run_on_all_urls = params.hasRunOnAllUrls(); |
| + mojoParams->run_on_all_urls = params.hasRunOnAllUrls() && params.runOnAllUrls(); |
| + mojoParams->has_show_action_button = params.hasShowActionButton(); |
| + mojoParams->show_action_button = params.hasShowActionButton() && params.showActionButton(); |
| + |
| + m_developerPrivate->UpdateExtensionConfiguration( |
| + UserGestureIndicator::processingUserGesture(), |
| + std::move(mojoParams), |
| + createBaseCallback(bind(&DeveloperPrivate::onUpdateExtensionConfigurationCallback, this, callback))); |
| +} |
| + |
| +void DeveloperPrivate::onUpdateExtensionConfigurationCallback(VoidCallback* callback) |
| +{ |
| + callback->handleEvent(); |
| +} |
| + |
| +} // namespace blink |