mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add global and per-browser settings (issue #145).
This exposes the following new capabilities: - Ability to disable drag & drop from other windows. - Ability to specify additional plugin search paths. - Ability to customize WebPreferences values, including enabling cross-site scripting. - Ability to set User-Agent or product version. - Ability to set default locale. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@144 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -161,23 +161,6 @@ void TranslatePopupFeatures(const WebWindowFeatures& webKitFeatures,
|
||||
|
||||
} // namespace
|
||||
|
||||
// WebViewDelegate -----------------------------------------------------------
|
||||
|
||||
void BrowserWebViewDelegate::SetUserStyleSheetEnabled(bool is_enabled) {
|
||||
WebPreferences* prefs = _Context->web_preferences();
|
||||
prefs->user_style_sheet_enabled = is_enabled;
|
||||
if (browser_->GetWebView())
|
||||
prefs->Apply(browser_->GetWebView());
|
||||
}
|
||||
|
||||
void BrowserWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) {
|
||||
WebPreferences* prefs = _Context->web_preferences();
|
||||
prefs->user_style_sheet_enabled = true;
|
||||
prefs->user_style_sheet_location = location;
|
||||
if (browser_->GetWebView())
|
||||
prefs->Apply(browser_->GetWebView());
|
||||
}
|
||||
|
||||
// WebViewClient -------------------------------------------------------------
|
||||
|
||||
WebView* BrowserWebViewDelegate::createView(WebFrame* creator,
|
||||
@@ -912,7 +895,8 @@ void BrowserWebViewDelegate::RegisterDragDrop() {
|
||||
|
||||
void BrowserWebViewDelegate::RevokeDragDrop() {
|
||||
#if defined(OS_WIN)
|
||||
::RevokeDragDrop(browser_->GetWebViewWndHandle());
|
||||
if (drop_delegate_.get())
|
||||
::RevokeDragDrop(browser_->GetWebViewWndHandle());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user