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

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

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Add TODO 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
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0b5db4345b09c172ed0ced603228f3cc9fae5721..8258ba2fc40b22cd53ee1769caa14977b89ad876 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -179,6 +179,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"
@@ -231,6 +232,7 @@
#include "wtf/PtrUtil.h"
#include <algorithm>
#include <memory>
+#include <utility>
namespace blink {
@@ -1615,11 +1617,19 @@ 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();
+ }
+
+ // TODO(dominickn): This interface should be document-scoped rather than
+ // frame-scoped, as the resulting banner event is dispatched to
+ // frame()->document().
+ frame()->interfaceRegistry()->addInterface(WTF::bind(
+ &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame())));
+ }
}
LocalFrame* WebLocalFrameImpl::createChildFrame(
@@ -2097,17 +2107,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());
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698