Changeset 73584 in webkit
- Timestamp:
- Dec 8, 2010 7:10:51 PM (13 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebframe.cpp
r73436 r73584 410 410 } 411 411 412 void QWebFrame::orientationChanged() 413 { 414 #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) 415 int orientation; 416 WebCore::Frame* frame = QWebFramePrivate::core(this); 417 418 switch (d->m_orientation.reading()->orientation()) { 419 case QtMobility::QOrientationReading::TopUp: 420 orientation = 0; 421 break; 422 case QtMobility::QOrientationReading::TopDown: 423 orientation = 180; 424 break; 425 case QtMobility::QOrientationReading::LeftUp: 426 orientation = -90; 427 break; 428 case QtMobility::QOrientationReading::RightUp: 429 orientation = 90; 430 break; 431 case QtMobility::QOrientationReading::FaceUp: 432 case QtMobility::QOrientationReading::FaceDown: 433 // WebCore unable to handle it 434 default: 435 return; 436 } 437 frame->sendOrientationChangeEvent(orientation); 438 #endif 439 } 412 440 /*! 413 441 \class QWebFrame … … 484 512 d->frame->loader()->load(request, frameData->name, false); 485 513 } 514 #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) 515 connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); 516 d->m_orientation.start(); 517 #endif 486 518 } 487 519 … … 492 524 d->page = parent->d->page; 493 525 d->init(this, frameData); 526 #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) 527 connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); 528 d->m_orientation.start(); 529 #endif 494 530 } 495 531 -
trunk/WebKit/qt/Api/qwebframe.h
r70487 r73584 206 206 #endif 207 207 208 private Q_SLOTS: 209 void orientationChanged(); 210 208 211 Q_SIGNALS: 209 212 void javaScriptWindowObjectCleared(); -
trunk/WebKit/qt/Api/qwebframe_p.h
r72055 r73584 29 29 #include "KURL.h" 30 30 #include "PlatformString.h" 31 #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) 32 #include "qorientationsensor.h" 33 #endif 31 34 #include "qwebelement.h" 32 35 #include "wtf/RefPtr.h" … … 37 40 #include "texmap/TextureMapper.h" 38 41 #endif 42 39 43 40 44 namespace WebCore { … … 115 119 OwnPtr<WebCore::TextureMapper> textureMapper; 116 120 #endif 121 122 #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) 123 QtMobility::QOrientationSensor m_orientation; 124 #endif 117 125 }; 118 126 -
trunk/WebKit/qt/ChangeLog
r73535 r73584 1 2010-12-08 Qi Zhang <qi.2.zhang@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Support OrientationChange event 6 https://bugs.webkit.org/show_bug.cgi?id=50685 7 8 Get OrientationChange event from qtmobility then send to webkit. 9 10 * Api/qwebframe.cpp: 11 (QWebFrame::orientationChanged): 12 (QWebFrame::QWebFrame): 13 * Api/qwebframe.h: 14 * Api/qwebframe_p.h: 15 1 16 2010-12-07 Brian Weinstein <bweinstein@apple.com> 2 17
Note: See TracChangeset
for help on using the changeset viewer.