[webkit-dev] How to add a progress bar of page loading with webkit?

Jickae Davis jickaed at gmail.com
Fri Oct 9 21:07:31 PDT 2009


I looked up them in chromium's source codes with VS2005.
It seems chromium makes a lot of changes on webkit. -_-

2009/10/9 John Sullivan <sullivan at apple.com>

>  I'm not sure where you are looking. This is from WebView.h:
>
>  /*
>     @discussion Notifications sent by WebView to mark the progress of
> loads.
>     @constant WebViewProgressStartedNotification Posted whenever a load
> begins in the WebView, including
>     a load that is initiated in a subframe.  After receiving this
> notification zero or more
>     WebViewProgressEstimateChangedNotifications will be sent.  The userInfo
> will be nil.
>     @constant WebViewProgressEstimateChangedNotification Posted whenever
> the value of
>     estimatedProgress changes.  The userInfo will be nil.
>     @constant WebViewProgressFinishedNotification Posted when the load for
> a WebView has finished.
>     The userInfo will be nil.
> */
> extern NSString *WebViewProgressStartedNotification;
> extern NSString *WebViewProgressEstimateChangedNotification;
> extern NSString *WebViewProgressFinishedNotification;
>
> ,,,
>
> /*!
>     @method estimatedProgress
>     @discussion An estimate of the percent complete for a document load.
> This
>     value will range from 0 to 1.0 and, once a load completes, will remain
> at 1.0
>     until a new load starts, at which point it will be reset to 0.  The
> value is an
>     estimate based on the total number of bytes expected to be received
>     for a document, including all it's possible subresources.  For more
> accurate progress
>     indication it is recommended that you implement a WebFrameLoadDelegate
> and a
>     WebResourceLoadDelegate.
> */
> - (double)estimatedProgress;
>
> John
>
>  On Oct 9, 2009, at 1:55 AM, Jickae Davis wrote:
>
>   Well, I checked the WebView.h, and didn't find the estimateProgress
> method and the three associated notifications.
>
> Then I searched them in the chrome's whole solution, didn't get any clue
> too.....
>
> 2009/9/28 John Sullivan <sullivan at apple.com>
>
>>  The Chrome and Safari teams have chosen not to display approximate
>> progress bars for user interface design reasons.
>>
>> You can implement a progress bar for a WebKit-based browser by using the
>> -estimatedProgress method in WebView.h and the associated
>> notifications WebViewProgressStartedNotification, WebViewProgressEstimateChangedNotification,
>> and WebViewProgressFinishedNotification.
>>
>> Note that any such progress bar (in any web browser, WebKit-based or not)
>> is only an approximation, because as a page loads resources, it might
>> discover additional resources that need to be loaded, so the page cannot
>> know in advance how much more there is to load.
>>
>> John
>>
>>   On Sep 28, 2009, at 12:14 AM, Jickae Davis wrote:
>>
>>   I'm wonderring why Chrome and Safari don't add a progress bar which
>> indicates the progress of loading a html page.
>> I took a look at all the ViewMsg and ViewHostMsg in Chrome's src, and
>> didn't find anything related.
>> So, is that unimpossible to create such a progress bar?
>>
>> If it's not so hard, how to achieve that?
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091010/0d45d3f1/attachment.html>


More information about the webkit-dev mailing list