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

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

Issue 374623002: [screen-orientation] Update implementation to match recent spec changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 ensureTextFinder().increaseMatchCount(identifier, count); 1367 ensureTextFinder().increaseMatchCount(identifier, count);
1368 } 1368 }
1369 1369
1370 void WebLocalFrameImpl::resetMatchCount() 1370 void WebLocalFrameImpl::resetMatchCount()
1371 { 1371 {
1372 ensureTextFinder().resetMatchCount(); 1372 ensureTextFinder().resetMatchCount();
1373 } 1373 }
1374 1374
1375 void WebLocalFrameImpl::sendOrientationChangeEvent() 1375 void WebLocalFrameImpl::sendOrientationChangeEvent()
1376 { 1376 {
1377 if (frame()) 1377 if (!frame())
1378 frame()->sendOrientationChangeEvent(); 1378 return;
1379
1380 // Screen Orientation API
1381 if (ScreenOrientationController::from(*frame()))
1382 ScreenOrientationController::from(*frame())->notifyOrientationChanged();
1383
1384 // Legacy window.orientation API.
1385 if (frame()->domWindow())
1386 frame()->domWindow()->dispatchEvent(Event::create(EventTypeNames::orient ationchange));
1379 } 1387 }
1380 1388
1381 void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOri gin& intendedTargetOrigin, const WebDOMEvent& event) 1389 void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOri gin& intendedTargetOrigin, const WebDOMEvent& event)
1382 { 1390 {
1383 ASSERT(!event.isNull()); 1391 ASSERT(!event.isNull());
1384 frame()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrig in.get(), event, nullptr); 1392 frame()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrig in.get(), event, nullptr);
1385 } 1393 }
1386 1394
1387 int WebLocalFrameImpl::findMatchMarkersVersion() const 1395 int WebLocalFrameImpl::findMatchMarkersVersion() const
1388 { 1396 {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 if (m_frame) { 1537 if (m_frame) {
1530 OwnPtr<NotificationPresenterImpl> notificationPresenter = adoptPtr(new N otificationPresenterImpl()); 1538 OwnPtr<NotificationPresenterImpl> notificationPresenter = adoptPtr(new N otificationPresenterImpl());
1531 if (m_client) 1539 if (m_client)
1532 notificationPresenter->initialize(m_client->notificationPresenter()) ; 1540 notificationPresenter->initialize(m_client->notificationPresenter()) ;
1533 1541
1534 provideNotification(*m_frame, notificationPresenter.release()); 1542 provideNotification(*m_frame, notificationPresenter.release());
1535 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); 1543 provideUserMediaTo(*m_frame, &m_userMediaClientImpl);
1536 provideGeolocationTo(*m_frame, m_geolocationClientProxy.get()); 1544 provideGeolocationTo(*m_frame, m_geolocationClientProxy.get());
1537 m_geolocationClientProxy->setController(GeolocationController::from(m_fr ame.get())); 1545 m_geolocationClientProxy->setController(GeolocationController::from(m_fr ame.get()));
1538 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->web MIDIClient() : 0)); 1546 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->web MIDIClient() : 0));
1539 if (RuntimeEnabledFeatures::screenOrientationEnabled())
1540 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client ->webScreenOrientationClient() : 0);
1541 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create()); 1547 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create());
1548
1549 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we bScreenOrientationClient() : 0);
1542 } 1550 }
1543 } 1551 }
1544 1552
1545 PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeWebCoreFrame(FrameHost* host , FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName) 1553 PassRefPtr<LocalFrame> WebLocalFrameImpl::initializeWebCoreFrame(FrameHost* host , FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName)
1546 { 1554 {
1547 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner); 1555 RefPtr<LocalFrame> frame = LocalFrame::create(&m_frameLoaderClientImpl, host , owner);
1548 setWebCoreFrame(frame); 1556 setWebCoreFrame(frame);
1549 frame->tree().setName(name, fallbackName); 1557 frame->tree().setName(name, fallbackName);
1550 // We must call init() after m_frame is assigned because it is referenced 1558 // We must call init() after m_frame is assigned because it is referenced
1551 // during init(). Note that this may dispatch JS events; the frame may be 1559 // during init(). Note that this may dispatch JS events; the frame may be
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 1850
1843 void WebLocalFrameImpl::invalidateAll() const 1851 void WebLocalFrameImpl::invalidateAll() const
1844 { 1852 {
1845 ASSERT(frame() && frame()->view()); 1853 ASSERT(frame() && frame()->view());
1846 FrameView* view = frame()->view(); 1854 FrameView* view = frame()->view();
1847 view->invalidateRect(view->frameRect()); 1855 view->invalidateRect(view->frameRect());
1848 invalidateScrollbar(); 1856 invalidateScrollbar();
1849 } 1857 }
1850 1858
1851 } // namespace blink 1859 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698