Changeset 52928 in webkit
- Timestamp:
- Jan 7, 2010 9:29:22 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52926 r52928 1 2010-01-07 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Allow the application to override online/offline network status 6 https://bugs.webkit.org/show_bug.cgi?id=32684 7 8 Added API to NetworkStateNotifier for forcing network status. 9 10 * platform/network/NetworkStateNotifier.h: 11 * platform/network/qt/NetworkStateNotifierPrivate.h: 12 * platform/network/qt/NetworkStateNotifierQt.cpp: 13 (WebCore::NetworkStateNotifierPrivate::NetworkStateNotifierPrivate): 14 (WebCore::NetworkStateNotifierPrivate::onlineStateChanged): 15 (WebCore::NetworkStateNotifierPrivate::networkAccessPermissionChanged): 16 (WebCore::NetworkStateNotifier::updateState): 17 (WebCore::NetworkStateNotifier::NetworkStateNotifier): 18 (WebCore::NetworkStateNotifier::setNetworkAccessAllowed): 19 1 20 2010-01-07 Simon Hausmann <simon.hausmann@nokia.com> 2 21 -
trunk/WebCore/platform/network/NetworkStateNotifier.h
r52635 r52928 59 59 60 60 bool onLine() const { return m_isOnLine; } 61 61 62 #if (PLATFORM(QT) && ENABLE(QT_BEARER)) 63 void setNetworkAccessAllowed(bool); 64 #endif 65 62 66 private: 63 67 bool m_isOnLine; -
trunk/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
r52261 r52928 38 38 public slots: 39 39 void onlineStateChanged(bool); 40 void networkAccessPermissionChanged(bool); 40 41 41 42 public: 42 43 QtMobility::QNetworkConfigurationManager* m_configurationManager; 43 44 bool m_online; 45 bool m_networkAccessAllowed; 44 46 NetworkStateNotifier* m_notifier; 45 47 }; -
trunk/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
r52261 r52928 31 31 : m_configurationManager(new QNetworkConfigurationManager()) 32 32 , m_online(m_configurationManager->isOnline()) 33 , m_networkAccessAllowed(true) 33 34 , m_notifier(notifier) 34 35 { … … 43 44 44 45 m_online = isOnline; 45 m_notifier->updateState(); 46 if (m_networkAccessAllowed) 47 m_notifier->updateState(); 48 } 49 50 void NetworkStateNotifierPrivate::networkAccessPermissionChanged(bool isAllowed) 51 { 52 if (isAllowed == m_networkAccessAllowed) 53 return; 54 55 m_networkAccessAllowed = isAllowed; 56 if (m_online) 57 m_notifier->updateState(); 46 58 } 47 59 … … 53 65 void NetworkStateNotifier::updateState() 54 66 { 55 if (m_isOnLine == p->m_online)67 if (m_isOnLine == (p->m_online && p->m_networkAccessAllowed)) 56 68 return; 57 69 58 m_isOnLine = p->m_online ;70 m_isOnLine = p->m_online && p->m_networkAccessAllowed; 59 71 if (m_networkStateChangedFunction) 60 72 m_networkStateChangedFunction(); … … 66 78 { 67 79 p = new NetworkStateNotifierPrivate(this); 68 m_isOnLine = p->m_online; 80 m_isOnLine = p->m_online && p->m_networkAccessAllowed; 81 } 82 83 void NetworkStateNotifier::setNetworkAccessAllowed(bool isAllowed) 84 { 85 p->networkAccessPermissionChanged(isAllowed); 69 86 } 70 87 -
trunk/WebKit/qt/Api/qwebsettings.cpp
r51154 r52928 47 47 #include <QUrl> 48 48 #include <QFileInfo> 49 50 #if ENABLE(QT_BEARER) 51 #include "NetworkStateNotifier.h" 52 #endif 53 54 void QWEBKIT_EXPORT qt_networkAccessAllowed(bool isAllowed) 55 { 56 #if ENABLE(QT_BEARER) 57 WebCore::networkStateNotifier().setNetworkAccessAllowed(isAllowed); 58 #endif 59 } 49 60 50 61 class QWebSettingsPrivate { -
trunk/WebKit/qt/ChangeLog
r52914 r52928 1 2010-01-07 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Allow the application to override online/offline network status 6 https://bugs.webkit.org/show_bug.cgi?id=32684 7 8 Add a setting so that applications can overide the network status. 9 Applications that use this setting still need to block network access 10 through QNAM. 11 12 * Api/qwebsettings.cpp: 13 (qt_networkAccessAllowed): 14 1 15 2010-01-07 Yongjun Zhang <yongjun.zhang@nokia.com>, Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 16
Note: See TracChangeset
for help on using the changeset viewer.