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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Add TODO Created 4 years, 1 month 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 #include "platform/graphics/skia/SkiaUtils.h" 172 #include "platform/graphics/skia/SkiaUtils.h"
173 #include "platform/heap/Handle.h" 173 #include "platform/heap/Handle.h"
174 #include "platform/network/ResourceRequest.h" 174 #include "platform/network/ResourceRequest.h"
175 #include "platform/scroll/ScrollTypes.h" 175 #include "platform/scroll/ScrollTypes.h"
176 #include "platform/scroll/ScrollbarTheme.h" 176 #include "platform/scroll/ScrollbarTheme.h"
177 #include "platform/tracing/TraceEvent.h" 177 #include "platform/tracing/TraceEvent.h"
178 #include "platform/weborigin/KURL.h" 178 #include "platform/weborigin/KURL.h"
179 #include "platform/weborigin/SchemeRegistry.h" 179 #include "platform/weborigin/SchemeRegistry.h"
180 #include "platform/weborigin/SecurityPolicy.h" 180 #include "platform/weborigin/SecurityPolicy.h"
181 #include "public/platform/InterfaceProvider.h" 181 #include "public/platform/InterfaceProvider.h"
182 #include "public/platform/InterfaceRegistry.h"
182 #include "public/platform/WebDoubleSize.h" 183 #include "public/platform/WebDoubleSize.h"
183 #include "public/platform/WebFloatPoint.h" 184 #include "public/platform/WebFloatPoint.h"
184 #include "public/platform/WebFloatRect.h" 185 #include "public/platform/WebFloatRect.h"
185 #include "public/platform/WebLayer.h" 186 #include "public/platform/WebLayer.h"
186 #include "public/platform/WebPoint.h" 187 #include "public/platform/WebPoint.h"
187 #include "public/platform/WebRect.h" 188 #include "public/platform/WebRect.h"
188 #include "public/platform/WebSecurityOrigin.h" 189 #include "public/platform/WebSecurityOrigin.h"
189 #include "public/platform/WebSize.h" 190 #include "public/platform/WebSize.h"
190 #include "public/platform/WebSuspendableTask.h" 191 #include "public/platform/WebSuspendableTask.h"
191 #include "public/platform/WebURLError.h" 192 #include "public/platform/WebURLError.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 #include "web/WebDevToolsAgentImpl.h" 225 #include "web/WebDevToolsAgentImpl.h"
225 #include "web/WebFrameWidgetImpl.h" 226 #include "web/WebFrameWidgetImpl.h"
226 #include "web/WebPluginContainerImpl.h" 227 #include "web/WebPluginContainerImpl.h"
227 #include "web/WebRemoteFrameImpl.h" 228 #include "web/WebRemoteFrameImpl.h"
228 #include "web/WebViewImpl.h" 229 #include "web/WebViewImpl.h"
229 #include "wtf/CurrentTime.h" 230 #include "wtf/CurrentTime.h"
230 #include "wtf/HashMap.h" 231 #include "wtf/HashMap.h"
231 #include "wtf/PtrUtil.h" 232 #include "wtf/PtrUtil.h"
232 #include <algorithm> 233 #include <algorithm>
233 #include <memory> 234 #include <memory>
235 #include <utility>
234 236
235 namespace blink { 237 namespace blink {
236 238
237 static int frameCount = 0; 239 static int frameCount = 0;
238 240
239 static HeapVector<ScriptSourceCode> createSourcesVector( 241 static HeapVector<ScriptSourceCode> createSourcesVector(
240 const WebScriptSource* sourcesIn, 242 const WebScriptSource* sourcesIn,
241 unsigned numSources) { 243 unsigned numSources) {
242 HeapVector<ScriptSourceCode> sources; 244 HeapVector<ScriptSourceCode> sources;
243 sources.append(sourcesIn, numSources); 245 sources.append(sourcesIn, numSources);
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 const AtomicString& uniqueName) { 1610 const AtomicString& uniqueName) {
1609 setCoreFrame( 1611 setCoreFrame(
1610 LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, 1612 LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner,
1611 client() ? client()->interfaceProvider() : nullptr, 1613 client() ? client()->interfaceProvider() : nullptr,
1612 client() ? client()->interfaceRegistry() : nullptr)); 1614 client() ? client()->interfaceRegistry() : nullptr));
1613 frame()->tree().setPrecalculatedName(name, uniqueName); 1615 frame()->tree().setPrecalculatedName(name, uniqueName);
1614 // We must call init() after m_frame is assigned because it is referenced 1616 // We must call init() after m_frame is assigned because it is referenced
1615 // during init(). Note that this may dispatch JS events; the frame may be 1617 // during init(). Note that this may dispatch JS events; the frame may be
1616 // detached after init() returns. 1618 // detached after init() returns.
1617 frame()->init(); 1619 frame()->init();
1618 if (frame() && 1620 if (frame()) {
1619 frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && 1621 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() &&
1620 !parent() && !opener() && 1622 !parent() && !opener() &&
1621 frame()->settings()->shouldReuseGlobalForUnownedMainFrame()) 1623 frame()->settings()->shouldReuseGlobalForUnownedMainFrame()) {
1622 frame()->document()->getSecurityOrigin()->grantUniversalAccess(); 1624 frame()->document()->getSecurityOrigin()->grantUniversalAccess();
1625 }
1626
1627 // TODO(dominickn): This interface should be document-scoped rather than
1628 // frame-scoped, as the resulting banner event is dispatched to
1629 // frame()->document().
1630 frame()->interfaceRegistry()->addInterface(WTF::bind(
1631 &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame())));
1632 }
1623 } 1633 }
1624 1634
1625 LocalFrame* WebLocalFrameImpl::createChildFrame( 1635 LocalFrame* WebLocalFrameImpl::createChildFrame(
1626 const FrameLoadRequest& request, 1636 const FrameLoadRequest& request,
1627 const AtomicString& name, 1637 const AtomicString& name,
1628 HTMLFrameOwnerElement* ownerElement) { 1638 HTMLFrameOwnerElement* ownerElement) {
1629 DCHECK(m_client); 1639 DCHECK(m_client);
1630 TRACE_EVENT0("blink", "WebLocalFrameImpl::createChildframe"); 1640 TRACE_EVENT0("blink", "WebLocalFrameImpl::createChildframe");
1631 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() 1641 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope()
1632 ? WebTreeScopeType::Document 1642 ? WebTreeScopeType::Document
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 2100
2091 // Screen Orientation API 2101 // Screen Orientation API
2092 if (ScreenOrientationController::from(*frame())) 2102 if (ScreenOrientationController::from(*frame()))
2093 ScreenOrientationController::from(*frame())->notifyOrientationChanged(); 2103 ScreenOrientationController::from(*frame())->notifyOrientationChanged();
2094 2104
2095 // Legacy window.orientation API 2105 // Legacy window.orientation API
2096 if (RuntimeEnabledFeatures::orientationEventEnabled() && frame()->domWindow()) 2106 if (RuntimeEnabledFeatures::orientationEventEnabled() && frame()->domWindow())
2097 frame()->localDOMWindow()->sendOrientationChangeEvent(); 2107 frame()->localDOMWindow()->sendOrientationChangeEvent();
2098 } 2108 }
2099 2109
2100 void WebLocalFrameImpl::willShowInstallBannerPrompt(
2101 int requestId,
2102 const WebVector<WebString>& platforms,
2103 WebAppBannerPromptReply* reply) {
2104 if (!frame())
2105 return;
2106
2107 AppBannerController::willShowInstallBannerPrompt(
2108 requestId, client()->appBannerClient(), frame(), platforms, reply);
2109 }
2110
2111 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const { 2110 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const {
2112 DCHECK(frame()); 2111 DCHECK(frame());
2113 DCHECK(frame()->document()); 2112 DCHECK(frame()->document());
2114 frame()->document()->postSuspendableTask( 2113 frame()->document()->postSuspendableTask(
2115 WebSuspendableTaskWrapper::create(wrapUnique(task))); 2114 WebSuspendableTaskWrapper::create(wrapUnique(task)));
2116 } 2115 }
2117 2116
2118 void WebLocalFrameImpl::didCallAddSearchProvider() { 2117 void WebLocalFrameImpl::didCallAddSearchProvider() {
2119 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider); 2118 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider);
2120 } 2119 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2387 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2386 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2388 } else if (metric == "wasAlternateProtocolAvailable") { 2387 } else if (metric == "wasAlternateProtocolAvailable") {
2389 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2388 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2390 } else if (metric == "connectionInfo") { 2389 } else if (metric == "connectionInfo") {
2391 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2390 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2392 } 2391 }
2393 UseCounter::count(frame(), feature); 2392 UseCounter::count(frame(), feature);
2394 } 2393 }
2395 2394
2396 } // namespace blink 2395 } // namespace blink
OLDNEW
« 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