Expose settings to disable plugin snapshotting autostart and primary detection
https://bugs.webkit.org/show_bug.cgi?id=113918

Reviewed by Tim Horton.

Source/WebCore:

Three new settings:
- snapshotAllPlugIns: Do not apply any heuristics - immediately snapshot a plugin.
- primaryPlugInSnapshotDetectionEnabled: Toggle snapshotting the "main" plugin in the page.
- autostartOriginPlugInSnapshottingEnabled: Toggle snapshotting based on URL origins.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Don't tell the host that we've started
    if the autostartOriginPlugInSnapshottingEnabled is false.
(WebCore::HTMLPlugInImageElement::setIsPrimarySnapshottedPlugIn): Don't restart a primary
    plugin if primaryPlugInSnapshotDetectionEnabled is false.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Snapshot immediately if
    snapshotAllPlugIns is true. Also, don't test for autostart if
    autostartOriginPlugInSnapshottingEnabled is false.
* page/Settings.in: Three new settings values.

Source/WebKit2:

Three new settings: snapshotAllPlugIns, primaryPlugInSnapshotDetectionEnabled and
autostartOriginPlugInSnapshottingEnabled.
These are exposed via WKPreferences (WebKit2 only, since that's the only port actively
using the feature).

* Shared/WebPreferencesStore.h: Add macros for new settings.
* UIProcess/API/C/WKPreferences.cpp: Getters and setters for new settings.
(WKPreferencesSetSnapshotAllPlugIns):
(WKPreferencesGetSnapshotAllPlugIns):
(WKPreferencesSetAutostartOriginPlugInSnapshottingEnabled):
(WKPreferencesGetAutostartOriginPlugInSnapshottingEnabled):
(WKPreferencesSetPrimaryPlugInSnapshotDetectionEnabled):
(WKPreferencesGetPrimaryPlugInSnapshotDetectionEnabled):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Forward settings updates.
(WebKit::WebPage::addPluginView): Don't run primary plugin detection if the setting is false.
(WebKit::WebPage::didFinishLoad): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147659 268f45cc-cd09-0410-ab3c-d52691b4dbfc