From 10d5754b9273aa826a36beb7c614d0fe0ac0b1d6 Mon Sep 17 00:00:00 2001 From: stippi Date: Mon, 1 Mar 2010 17:41:43 +0000 Subject: [PATCH] Added BWebSettings and BPrivate::WebSettingsPrivate. Added all the wiring necessary. The only usable effect as of yet is that favicons arrive at the BrowserWindow. Favicons are stored in a database and are not fetched when they alreary exist. The application is expected to try and fetch an icon for a given url. This is currently done in BWebWindow when the URL for loading has been initiated. Otherwise it fetches the URL upon the new ICON_RECEIVED notification from the FrameLoaderClientHaiku. In any case it ends up at BWebWindow::IconReceived(), so derived classes don't have to worry about the difference. In any case, via BWebSettings, icons can also be fetched manually, like for the forthcomming autocompletion text control. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@257 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserApp.cpp | 4 +++- src/apps/webpositive/BrowserWindow.cpp | 7 +++++++ src/apps/webpositive/BrowserWindow.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/BrowserApp.cpp b/src/apps/webpositive/BrowserApp.cpp index b12c380eff..67ce27db15 100644 --- a/src/apps/webpositive/BrowserApp.cpp +++ b/src/apps/webpositive/BrowserApp.cpp @@ -32,8 +32,8 @@ #include "BrowserWindow.h" #include "DownloadWindow.h" #include "WebPage.h" +#include "WebSettings.h" #include "WebView.h" -#include "WebViewConstants.h" #include #include #include @@ -104,6 +104,8 @@ BrowserApp::ReadyToRun() BWebPage::InitializeOnce(); BWebPage::SetCacheModel(B_WEBKIT_CACHE_MODEL_WEB_BROWSER); + BWebSettings::SetPersistentStoragePath("/boot/home/config/settings/WebPositive"); + BFile settingsFile; BRect windowFrameFromSettings = fLastWindowFrame; BRect downloadWindowFrame(100, 100, 300, 250); diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 0fa866009e..c72925f889 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -700,6 +700,13 @@ BrowserWindow::TitleChanged(const BString& title, BWebView* view) } +void +BrowserWindow::IconReceived(const BBitmap* icon, BWebView* view) +{ + printf("BrowserWindow::IconReceived(%p, %p)\n", icon, view); +} + + void BrowserWindow::StatusChanged(const BString& statusText, BWebView* view) { diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index 568a49670a..9ef4426942 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -94,6 +94,8 @@ private: BWebView* view); virtual void TitleChanged(const BString& title, BWebView* view); + virtual void IconReceived(const BBitmap* icon, + BWebView* view); virtual void ResizeRequested(float width, float height, BWebView* view); virtual void SetToolBarsVisible(bool flag, BWebView* view);