Commit d7693eac authored by dino@apple.com's avatar dino@apple.com

Allow some plugin snapshot UI content to come from Injected Bundle

https://bugs.webkit.org/show_bug.cgi?id=107852

Reviewed by Anders Carlsson.

Source/WebKit2:

Hook up three new methods: plugInStartLabelTitle, plugInStartLabelSubtitle and
plugInExtraStyleSheet to allow some custom styling and content to come
from the InjectedBundle.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h: Callbacks added to
WKBundlePageUIClient structure.
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: Stub implementations
of the three new methods.
(WebKit::InjectedBundlePageUIClient::plugInStartLabelTitle):
(WebKit::InjectedBundlePageUIClient::plugInStartLabelSubtitle):
(WebKit::InjectedBundlePageUIClient::plugInExtraStyleSheet):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
(InjectedBundlePageUIClient):
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Call into the injected bundle
for each of these methods.
(WebKit::WebChromeClient::plugInStartLabelTitle):
(WebKit::WebChromeClient::plugInStartLabelSubtitle):
(WebKit::WebChromeClient::plugInExtraStyleSheet):
* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient): Declare the virtual methods in the Chrome
Client so that they can accessed from WebCore eventually.

Tools:

Null implementations of plugInStartLabelTitle, plugInStartLabelSubtitle and
plugInExtraStyleSheet.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a042db73
2013-01-24 Dean Jackson <dino@apple.com>
Allow some plugin snapshot UI content to come from Injected Bundle
https://bugs.webkit.org/show_bug.cgi?id=107852
Reviewed by Anders Carlsson.
Hook up three new methods: plugInStartLabelTitle, plugInStartLabelSubtitle and
plugInExtraStyleSheet to allow some custom styling and content to come
from the InjectedBundle.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h: Callbacks added to
WKBundlePageUIClient structure.
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: Stub implementations
of the three new methods.
(WebKit::InjectedBundlePageUIClient::plugInStartLabelTitle):
(WebKit::InjectedBundlePageUIClient::plugInStartLabelSubtitle):
(WebKit::InjectedBundlePageUIClient::plugInExtraStyleSheet):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
(InjectedBundlePageUIClient):
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Call into the injected bundle
for each of these methods.
(WebKit::WebChromeClient::plugInStartLabelTitle):
(WebKit::WebChromeClient::plugInStartLabelSubtitle):
(WebKit::WebChromeClient::plugInExtraStyleSheet):
* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient): Declare the virtual methods in the Chrome
Client so that they can accessed from WebCore eventually.
2013-01-24 Anders Carlsson <andersca@apple.com>
Add stubbed out StorageNamespaceProxy class
......@@ -249,6 +249,9 @@ typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback
typedef void (*WKBundlePageReachedAppCacheOriginQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, int64_t totalBytesNeeded, const void *clientInfo);
typedef uint64_t (*WKBundlePageExceededDatabaseQuotaCallback)(WKBundlePageRef page, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes, const void *clientInfo);
typedef WKImageRef (*WKBundlePagePlugInStartLabelImageCallback)(WKBundlePageLabelSize size, const void *clientInfo);
typedef WKStringRef (*WKBundlePagePlugInStartLabelTitleCallback)(const void *clientInfo);
typedef WKStringRef (*WKBundlePagePlugInStartLabelSubtitleCallback)(const void *clientInfo);
typedef WKStringRef (*WKBundlePagePlugInExtraStyleSheetCallback)(const void *clientInfo);
struct WKBundlePageUIClient {
int version;
......@@ -274,6 +277,9 @@ struct WKBundlePageUIClient {
// Version 2.
WKBundlePageExceededDatabaseQuotaCallback didExceedDatabaseQuota;
WKBundlePagePlugInStartLabelImageCallback plugInStartLabelImage;
WKBundlePagePlugInStartLabelTitleCallback plugInStartLabelTitle;
WKBundlePagePlugInStartLabelSubtitleCallback plugInStartLabelSubtitle;
WKBundlePagePlugInExtraStyleSheetCallback plugInExtraStyleSheet;
};
typedef struct WKBundlePageUIClient WKBundlePageUIClient;
......
......@@ -183,4 +183,19 @@ PassRefPtr<WebImage> InjectedBundlePageUIClient::plugInStartLabelImage(RenderSna
return adoptRef(toImpl(m_client.plugInStartLabelImage(wkSize, m_client.clientInfo)));
}
String InjectedBundlePageUIClient::plugInStartLabelTitle() const
{
return String();
}
String InjectedBundlePageUIClient::plugInStartLabelSubtitle() const
{
return String();
}
String InjectedBundlePageUIClient::plugInExtraStyleSheet() const
{
return String();
}
} // namespace WebKit
......@@ -72,6 +72,10 @@ public:
uint64_t didExceedDatabaseQuota(WebPage*, WebSecurityOrigin*, const String& databaseName, const String& databaseDisplayName, uint64_t currentQuotaBytes, uint64_t currentOriginUsageBytes, uint64_t currentDatabaseUsageBytes, uint64_t expectedUsageBytes);
PassRefPtr<WebImage> plugInStartLabelImage(WebCore::RenderSnapshottedPlugIn::LabelSize) const;
String plugInStartLabelTitle() const;
String plugInStartLabelSubtitle() const;
String plugInExtraStyleSheet() const;
};
} // namespace WebKit
......
......@@ -805,4 +805,19 @@ PassRefPtr<Image> WebChromeClient::plugInStartLabelImage(RenderSnapshottedPlugIn
return m_page->injectedBundleUIClient().plugInStartLabelImage(size)->bitmap()->createImage();
}
String WebChromeClient::plugInStartLabelTitle() const
{
return m_page->injectedBundleUIClient().plugInStartLabelTitle();
}
String WebChromeClient::plugInStartLabelSubtitle() const
{
return m_page->injectedBundleUIClient().plugInStartLabelSubtitle();
}
String WebChromeClient::plugInExtraStyleSheet() const
{
return m_page->injectedBundleUIClient().plugInExtraStyleSheet();
}
} // namespace WebKit
......@@ -219,6 +219,9 @@ private:
virtual void logDiagnosticMessage(const String& message, const String& description, const String& success) OVERRIDE;
virtual PassRefPtr<WebCore::Image> plugInStartLabelImage(WebCore::RenderSnapshottedPlugIn::LabelSize) const OVERRIDE;
virtual String plugInStartLabelTitle() const;
virtual String plugInStartLabelSubtitle() const;
virtual String plugInExtraStyleSheet() const;
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
......
2013-01-24 Dean Jackson <dino@apple.com>
Allow some plugin snapshot UI content to come from Injected Bundle
https://bugs.webkit.org/show_bug.cgi?id=107852
Reviewed by Anders Carlsson.
Null implementations of plugInStartLabelTitle, plugInStartLabelSubtitle and
plugInExtraStyleSheet.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
2013-01-24 Erik Arvidsson <arv@chromium.org>
Unreviewed, rolling out r140561.
......
......@@ -377,6 +377,9 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
didReachApplicationCacheOriginQuota,
didExceedDatabaseQuota,
0, /*plugInStartLabelImage*/
0, /*plugInStartLabelTitle*/
0, /*plugInStartLabelSubtitle*/
0, /*plugInExtraStyleSheet*/
};
WKBundlePageSetUIClient(m_page, &uiClient);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment