Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2424)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 25505007: Remove bogus use of the term "user style" in Blink and Blink API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ca0ddc7bb21b392181f2a278f4c66bfd01f8fc8b..79a4b6a6120e5654b9408e00facd6dd4e66a58a5 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3661,30 +3661,29 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
#endif
}
-void WebView::addUserStyleSheet(const WebString& sourceCode,
- const WebVector<WebString>& patternsIn,
- WebView::UserContentInjectIn injectIn,
- WebView::UserStyleInjectionTime injectionTime)
+void WebView::injectStyleSheet(const WebString& sourceCode, const WebVector<WebString>& patternsIn, WebView::StyleInjectionTarget injectIn)
{
Vector<String> patterns;
for (size_t i = 0; i < patternsIn.size(); ++i)
patterns.append(patternsIn[i]);
PageGroup* pageGroup = PageGroup::sharedGroup();
+ pageGroup->injectStyleSheet(sourceCode, patterns, static_cast<WebCore::StyleInjectionTarget>(injectIn));
+}
- // FIXME: Current callers always want the level to be "author". It probably makes sense to let
- // callers specify this though, since in other cases the caller will probably want "user" level.
- //
- // FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL.
- pageGroup->addUserStyleSheet(sourceCode, WebURL(), patterns, Vector<String>(),
- static_cast<UserContentInjectedFrames>(injectIn),
- UserStyleAuthorLevel,
- static_cast<WebCore::UserStyleInjectionTime>(injectionTime));
+void WebView::removeInjectedStyleSheets()
+{
+ PageGroup::sharedGroup()->removeInjectedStyleSheets();
+}
+
+void WebView::addUserStyleSheet(const WebString& sourceCode, const WebVector<WebString>& patternsIn, WebView::UserContentInjectIn injectIn, WebView::UserStyleInjectionTime)
+{
+ injectStyleSheet(sourceCode, patternsIn, injectIn == UserContentInjectInAllFrames ? InjectStyleInAllFrames : InjectStyleInTopFrameOnly);
}
void WebView::removeAllUserContent()
{
- PageGroup::sharedGroup()->removeAllUserContent();
+ removeInjectedStyleSheets();
}
void WebViewImpl::didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPage)
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698