Changeset 57974 in webkit
- Timestamp:
- Apr 21, 2010 6:32:56 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r57966 r57974 1 2010-04-21 Balazs Kelemen <kb@inf.u-szeged.hu> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Interrupting JavaScript is cumbersome when you use QtLaucher for testing or profiling. 6 https://bugs.webkit.org/show_bug.cgi?id=37198 7 8 * QtLauncher/main.cpp: 9 (LauncherWindow::toggleInterruptingJavaScriptEnabled): 10 (LauncherWindow::newWindow): 11 (LauncherWindow::cloneWindow): 12 (LauncherWindow::createChrome): 13 (main): 14 * QtLauncher/webpage.cpp: 15 (WebPage::WebPage): 16 (WebPage::shouldInterruptJavaScript): 17 * QtLauncher/webpage.h: 18 (WebPage::setInterruptingJavaScriptEnabled): 19 1 20 2010-04-21 Eric Seidel <eric@webkit.org> 2 21 -
trunk/WebKitTools/QtLauncher/main.cpp
r57897 r57974 144 144 void changeViewportUpdateMode(int mode); 145 145 void toggleFrameFlattening(bool toggle); 146 void toggleInterruptingJavaScriptEnabled(bool enable); 146 147 147 148 #if defined(QT_CONFIGURED_WITH_OPENGL) … … 152 153 153 154 public slots: 154 voidnewWindow();155 voidcloneWindow();155 LauncherWindow* newWindow(); 156 LauncherWindow* cloneWindow(); 156 157 void updateFPS(int fps); 157 158 … … 701 702 } 702 703 704 void LauncherWindow::toggleInterruptingJavaScriptEnabled(bool enable) 705 { 706 page()->setInterruptingJavaScriptEnabled(enable); 707 } 708 703 709 #if defined(QT_CONFIGURED_WITH_OPENGL) 704 710 void LauncherWindow::toggleQGLWidgetViewport(bool enable) … … 759 765 } 760 766 761 voidLauncherWindow::newWindow()767 LauncherWindow* LauncherWindow::newWindow() 762 768 { 763 769 LauncherWindow* mw = new LauncherWindow(this, false); 764 770 mw->show(); 765 } 766 767 void LauncherWindow::cloneWindow() 771 return mw; 772 } 773 774 LauncherWindow* LauncherWindow::cloneWindow() 768 775 { 769 776 LauncherWindow* mw = new LauncherWindow(this, true); 770 777 mw->show(); 778 return mw; 771 779 } 772 780 … … 892 900 toggleFrameFlattening->setChecked(settings->testAttribute(QWebSettings::FrameFlatteningEnabled)); 893 901 902 QAction* toggleInterruptingJavaScripteEnabled = toolsMenu->addAction("Enable interrupting js scripts", this, SLOT(toggleInterruptingJavaScriptEnabled(bool))); 903 toggleInterruptingJavaScripteEnabled->setCheckable(true); 904 toggleInterruptingJavaScripteEnabled->setChecked(false); 905 894 906 #if defined(QT_CONFIGURED_WITH_OPENGL) 895 907 QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool))); … … 1183 1195 LauncherWindow* window = 0; 1184 1196 foreach (QString url, urls) { 1197 LauncherWindow* newWindow; 1185 1198 if (!window) 1186 window = new LauncherWindow();1199 newWindow = window = new LauncherWindow(); 1187 1200 else 1188 window->newWindow();1189 1190 window->load(url);1201 newWindow = window->newWindow(); 1202 1203 newWindow->load(url); 1191 1204 } 1192 1205 -
trunk/WebKitTools/QtLauncher/webpage.cpp
r56636 r57974 40 40 WebPage::WebPage(QObject* parent) 41 41 : QWebPage(parent) 42 , m_userAgent() 43 , m_interruptingJavaScriptEnabled(false) 42 44 { 43 45 applyProxy(); … … 110 112 return QWebPage::userAgentForUrl(url); 111 113 } 114 115 bool WebPage::shouldInterruptJavaScript() 116 { 117 if (!m_interruptingJavaScriptEnabled) 118 return false; 119 return QWebPage::shouldInterruptJavaScript(); 120 } -
trunk/WebKitTools/QtLauncher/webpage.h
r56636 r57974 51 51 52 52 QString userAgentForUrl(const QUrl& url) const; 53 void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; } 53 54 54 55 public slots: 55 56 void openUrlInDefaultBrowser(const QUrl& url = QUrl()); 56 57 void setUserAgent(const QString& ua) { m_userAgent = ua; } 58 bool shouldInterruptJavaScript(); 57 59 58 60 private: 59 61 void applyProxy(); 60 62 QString m_userAgent; 63 bool m_interruptingJavaScriptEnabled; 61 64 }; 62 65
Note: See TracChangeset
for help on using the changeset viewer.