~abreu-alexandre/webbrowser-app/desktop-ua-override-fix-regexp

« back to all changes in this revision

Viewing changes to src/app/webbrowser/Browser.qml

  • Committer: CI bot
  • Author(s): Olivier Tilloy
  • Date: 2014-03-17 11:56:55 UTC
  • mfrom: (458.1.14 private-types)
  • Revision ID: ps-jenkins@lists.canonical.com-20140317115655-jzub8c3sltmabpub
Do not register private types in the public plugin.
Register them in the webbrowser application scope instead.

I have made sure that private types that were previously public are currently not being used by any application in the store, so this refactoring is safe. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import QtWebKit 3.1
21
21
import QtWebKit.experimental 1.0
22
22
import Ubuntu.Components 0.1
23
 
import Ubuntu.Components.Extras.Browser 0.1
 
23
import webbrowserapp.private 0.1
24
24
import "../actions" as Actions
25
25
import ".."
26
26
 
211
211
 
212
212
            currentWebview: browser.currentWebview
213
213
            toolbar: panel.panel
214
 
            historyModel: _historyModel
215
214
 
216
215
            anchors.fill: parent
217
216
 
244
243
            }
245
244
 
246
245
            onNewTabRequested: newTab(url, true)
 
246
 
 
247
            WebviewThumbnailer {
 
248
                id: thumbnailer
 
249
                webview: webview
 
250
                targetSize: Qt.size(units.gu(12), units.gu(12))
 
251
                property url thumbnailSource: "image://webthumbnail/" + webview.url
 
252
                onThumbnailRendered: {
 
253
                    if (url == webview.url) {
 
254
                        webview.thumbnail = thumbnailer.thumbnailSource
 
255
                    }
 
256
                }
 
257
            }
 
258
            property url thumbnail: (url && thumbnailer.thumbnailExists()) ? thumbnailer.thumbnailSource : ""
 
259
 
 
260
            onLoadingChanged: {
 
261
                if (loadRequest.status === WebView.LoadSucceededStatus) {
 
262
                    _historyModel.add(webview.url, webview.title, webview.icon)
 
263
                    if (!thumbnailer.thumbnailExists()) {
 
264
                        thumbnailer.renderThumbnail()
 
265
                    }
 
266
                }
 
267
            }
247
268
        }
248
269
    }
249
270