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

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

Issue 1794553002: [Playground] Onion Soup: moving ScreenWakeLock to Blink modules/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit DEPS Created 4 years, 8 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 unified diff | Download patch
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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 webFrame->setFrameOwnerProperties(frameOwnerProperties); 1442 webFrame->setFrameOwnerProperties(frameOwnerProperties);
1443 } 1443 }
1444 1444
1445 // We must call init() after m_frame is assigned because it is referenced 1445 // We must call init() after m_frame is assigned because it is referenced
1446 // during init(). Note that this may dispatch JS events; the frame may be 1446 // during init(). Note that this may dispatch JS events; the frame may be
1447 // detached after init() returns. 1447 // detached after init() returns.
1448 frame->init(); 1448 frame->init();
1449 return webFrame; 1449 return webFrame;
1450 } 1450 }
1451 1451
1452
1453 WebLocalFrameImpl::WebLocalFrameImpl(WebTreeScopeType scope, WebFrameClient* cli ent) 1452 WebLocalFrameImpl::WebLocalFrameImpl(WebTreeScopeType scope, WebFrameClient* cli ent)
1454 : WebLocalFrame(scope) 1453 : WebLocalFrame(scope)
1455 , m_frameLoaderClientImpl(FrameLoaderClientImpl::create(this)) 1454 , m_frameLoaderClientImpl(FrameLoaderClientImpl::create(this))
1456 , m_frameWidget(0) 1455 , m_frameWidget(0)
1457 , m_client(client) 1456 , m_client(client)
1458 , m_autofillClient(0) 1457 , m_autofillClient(0)
1459 , m_contentSettingsClient(0) 1458 , m_contentSettingsClient(0)
1460 , m_inputEventsScaleFactorForEmulation(1) 1459 , m_inputEventsScaleFactorForEmulation(1)
1461 , m_userMediaClientImpl(this) 1460 , m_userMediaClientImpl(this)
1462 , m_geolocationClientProxy(GeolocationClientProxy::create(client ? client->g eolocationClient() : 0)) 1461 , m_geolocationClientProxy(GeolocationClientProxy::create(client ? client->g eolocationClient() : 0))
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::cr eate(this)); 1519 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::cr eate(this));
1521 1520
1522 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled(); 1521 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled();
1523 #if OS(CHROMEOS) || OS(ANDROID) 1522 #if OS(CHROMEOS) || OS(ANDROID)
1524 enableWebBluetooth = true; 1523 enableWebBluetooth = true;
1525 #endif 1524 #endif
1526 1525
1527 if (enableWebBluetooth) 1526 if (enableWebBluetooth)
1528 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth( ) : nullptr); 1527 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth( ) : nullptr);
1529 1528
1529 if (RuntimeEnabledFeatures::wakeLockEnabled())
1530 provideScreenWakeLockTo(*m_frame, client() ? client()->serviceRegistry() : nullptr);
1531
1530 if (RuntimeEnabledFeatures::screenOrientationEnabled()) 1532 if (RuntimeEnabledFeatures::screenOrientationEnabled())
1531 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we bScreenOrientationClient() : nullptr); 1533 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we bScreenOrientationClient() : nullptr);
1532 if (RuntimeEnabledFeatures::presentationEnabled()) 1534 if (RuntimeEnabledFeatures::presentationEnabled())
1533 PresentationController::provideTo(*m_frame, m_client ? m_client->present ationClient() : nullptr); 1535 PresentationController::provideTo(*m_frame, m_client ? m_client->present ationClient() : nullptr);
1534 if (RuntimeEnabledFeatures::permissionsEnabled()) 1536 if (RuntimeEnabledFeatures::permissionsEnabled())
1535 PermissionController::provideTo(*m_frame, m_client ? m_client->permissio nClient() : nullptr); 1537 PermissionController::provideTo(*m_frame, m_client ? m_client->permissio nClient() : nullptr);
1536 if (RuntimeEnabledFeatures::webUSBEnabled()) 1538 if (RuntimeEnabledFeatures::webUSBEnabled())
1537 USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nu llptr); 1539 USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nu llptr);
1538 if (RuntimeEnabledFeatures::webVREnabled()) 1540 if (RuntimeEnabledFeatures::webVREnabled())
1539 VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : n ullptr); 1541 VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : n ullptr);
1540 if (RuntimeEnabledFeatures::wakeLockEnabled())
1541 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient( ) : nullptr);
1542 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1542 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1543 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl:: create()); 1543 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl:: create());
1544 if (RuntimeEnabledFeatures::installedAppEnabled()) 1544 if (RuntimeEnabledFeatures::installedAppEnabled())
1545 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install edAppClient() : nullptr); 1545 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install edAppClient() : nullptr);
1546 } 1546 }
1547 1547
1548 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName) 1548 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName)
1549 { 1549 {
1550 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, client() ? client()->serviceRegistry() : nullptr)); 1550 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, client() ? client()->serviceRegistry() : nullptr));
1551 frame()->tree().setPrecalculatedName(name, uniqueName); 1551 frame()->tree().setPrecalculatedName(name, uniqueName);
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 return WebSandboxFlags::None; 2168 return WebSandboxFlags::None;
2169 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2169 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2170 } 2170 }
2171 2171
2172 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2172 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2173 { 2173 {
2174 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2174 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2175 } 2175 }
2176 2176
2177 } // namespace blink 2177 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/BUILD.gn ('k') | third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698