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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Replace WeakPersistent with Persistent Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 2c3891b0241afdff6d33ae526e37e046c29b42e1..59b0573153b1c48dd4e2b8be4ff348ba822495e3 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -177,6 +177,7 @@
#include "platform/weborigin/SchemeRegistry.h"
#include "platform/weborigin/SecurityPolicy.h"
#include "public/platform/InterfaceProvider.h"
+#include "public/platform/InterfaceRegistry.h"
#include "public/platform/WebDoubleSize.h"
#include "public/platform/WebFloatPoint.h"
#include "public/platform/WebFloatRect.h"
@@ -228,6 +229,7 @@
#include "wtf/PtrUtil.h"
#include <algorithm>
#include <memory>
+#include <utility>
namespace blink {
@@ -1614,11 +1616,16 @@ void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host,
// during init(). Note that this may dispatch JS events; the frame may be
// detached after init() returns.
frame()->init();
- if (frame() &&
- frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() &&
- !parent() && !opener() &&
- frame()->settings()->shouldReuseGlobalForUnownedMainFrame())
- frame()->document()->getSecurityOrigin()->grantUniversalAccess();
+ if (frame()) {
+ if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() &&
+ !parent() && !opener() &&
+ frame()->settings()->shouldReuseGlobalForUnownedMainFrame()) {
+ frame()->document()->getSecurityOrigin()->grantUniversalAccess();
+ }
+
+ frame()->interfaceRegistry()->addInterface(
+ WTF::bind(&AppBannerController::create, wrapPersistent(frame())));
haraken 2016/10/20 15:51:23 I'm just curious but why does addInterface take a
dominickn 2016/10/20 23:41:18 addInterface registers a WTF::Function(request) ca
haraken 2016/10/21 08:59:45 Sorry for being noisy, but where is the expected r
dominickn 2016/10/21 12:26:57 The short answer is template magic. :) The long a
haraken 2016/10/23 22:42:15 Thanks, makes sense. I'd personally prefer a more
+ }
}
LocalFrame* WebLocalFrameImpl::createChildFrame(
@@ -2089,17 +2096,6 @@ void WebLocalFrameImpl::sendOrientationChangeEvent() {
frame()->localDOMWindow()->sendOrientationChangeEvent();
}
-void WebLocalFrameImpl::willShowInstallBannerPrompt(
- int requestId,
- const WebVector<WebString>& platforms,
- WebAppBannerPromptReply* reply) {
- if (!frame())
- return;
-
- AppBannerController::willShowInstallBannerPrompt(
- requestId, client()->appBannerClient(), frame(), platforms, reply);
-}
-
void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const {
DCHECK(frame());
DCHECK(frame()->document());

Powered by Google App Engine
This is Rietveld 408576698