summaryrefslogtreecommitdiffstats
path: root/WebKit/win/WebIconDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/win/WebIconDatabase.cpp')
-rw-r--r--WebKit/win/WebIconDatabase.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/WebKit/win/WebIconDatabase.cpp b/WebKit/win/WebIconDatabase.cpp
index 5f9121f..237438c 100644
--- a/WebKit/win/WebIconDatabase.cpp
+++ b/WebKit/win/WebIconDatabase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -71,6 +71,15 @@ void WebIconDatabase::init()
LOG_ERROR("Unable to get icon database enabled preference");
}
iconDatabase()->setEnabled(!!enabled);
+ if (!(!!enabled))
+ return;
+
+ startUpIconDatabase();
+}
+
+void WebIconDatabase::startUpIconDatabase()
+{
+ WebPreferences* standardPrefs = WebPreferences::sharedStandardPreferences();
iconDatabase()->setClient(this);
@@ -91,6 +100,10 @@ void WebIconDatabase::init()
LOG_ERROR("Failed to open icon database path");
}
+void WebIconDatabase::shutDownIconDatabase()
+{
+}
+
WebIconDatabase* WebIconDatabase::createInstance()
{
WebIconDatabase* instance = new WebIconDatabase();
@@ -225,6 +238,28 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::iconURLForURL(
return S_OK;
}
+HRESULT STDMETHODCALLTYPE WebIconDatabase::isEnabled(
+ /* [retval][out] */ BOOL *result)
+{
+ *result = iconDatabase()->isEnabled();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebIconDatabase::setEnabled(
+ /* [in] */ BOOL flag)
+{
+ BOOL currentlyEnabled;
+ isEnabled(&currentlyEnabled);
+ if (currentlyEnabled && !flag) {
+ iconDatabase()->setEnabled(false);
+ shutDownIconDatabase();
+ } else if (!currentlyEnabled && flag) {
+ iconDatabase()->setEnabled(true);
+ startUpIconDatabase();
+ }
+ return S_OK;
+}
+
HBITMAP createDIB(LPSIZE size)
{
HBITMAP result;