Changeset 29862 in webkit


Ignore:
Timestamp:
Jan 29, 2008 6:45:51 PM (16 years ago)
Author:
Adam Roben
Message:

Fix Bug 16786: "Display images when page opens" preference affects Inspector

<http://bugs.webkit.org/show_bug.cgi?id=16786>
<rdar://5712914>

Reviewed by Anders and Darin.

  • WebInspectorClient.cpp: (WebInspectorClient::createPage): Create our own custom WebPreferences so that we won't be affected by global preference changes. This matches what Mac does.
Location:
trunk/WebKit/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r29851 r29862  
     12008-01-29  Adam Roben  <aroben@apple.com>
     2
     3        Fix Bug 16786: "Display images when page opens" preference affects
     4        Inspector
     5
     6        <http://bugs.webkit.org/show_bug.cgi?id=16786>
     7        <rdar://5712914>
     8
     9        Reviewed by Anders and Darin.
     10
     11        * WebInspectorClient.cpp:
     12        (WebInspectorClient::createPage): Create our own custom WebPreferences
     13        so that we won't be affected by global preference changes. This
     14        matches what Mac does.
     15
    1162008-01-29  Adam Roben  <aroben@apple.com>
    217
  • trunk/WebKit/win/WebInspectorClient.cpp

    r29851 r29862  
    116116    m_webView.adoptRef(WebView::createInstance());
    117117
     118    // Keep preferences separate from the rest of the client, making sure we are using expected preference values.
     119    // One reason this is good is that it keeps the inspector out of history via "private browsing".
     120    COMPtr<WebPreferences> preferences(AdoptCOM, WebPreferences::createInstance());
     121    if (FAILED(preferences->setAutosaves(FALSE)))
     122        return 0;
     123    if (FAILED(preferences->setPrivateBrowsingEnabled(TRUE)))
     124        return 0;
     125    if (FAILED(preferences->setLoadsImagesAutomatically(TRUE)))
     126        return 0;
     127    if (FAILED(preferences->setAuthorAndUserStylesEnabled(TRUE)))
     128        return 0;
     129    if (FAILED(preferences->setAllowsAnimatedImages(TRUE)))
     130        return 0;
     131    if (FAILED(preferences->setLoadsImagesAutomatically(TRUE)))
     132        return 0;
     133    if (FAILED(preferences->setPlugInsEnabled(FALSE)))
     134        return 0;
     135    if (FAILED(preferences->setJavaEnabled(FALSE)))
     136        return 0;
     137    if (FAILED(preferences->setUserStyleSheetEnabled(FALSE)))
     138        return 0;
     139    if (FAILED(preferences->setTabsToLinks(FALSE)))
     140        return 0;
     141    if (FAILED(preferences->setMinimumFontSize(0)))
     142        return 0;
     143    if (FAILED(preferences->setMinimumLogicalFontSize(9)))
     144        return 0;
     145
     146    if (FAILED(m_webView->setPreferences(preferences.get())))
     147        return 0;
     148
    118149    if (FAILED(m_webView->setHostWindow((OLE_HANDLE)(ULONG64)m_hwnd)))
    119150        return 0;
Note: See TracChangeset for help on using the changeset viewer.