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

Unified Diff: third_party/WebKit/public/web/WebDocument.h

Issue 2835183002: Provide a method to remove inserted style sheet (Closed)
Patch Set: initial for review Created 3 years, 7 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
Index: third_party/WebKit/public/web/WebDocument.h
diff --git a/third_party/WebKit/public/web/WebDocument.h b/third_party/WebKit/public/web/WebDocument.h
index af9497b88337b948de03fb3dc6a995a22bfce308..717cb948b06467eaa2f68e46408a9033b1235e9f 100644
--- a/third_party/WebKit/public/web/WebDocument.h
+++ b/third_party/WebKit/public/web/WebDocument.h
@@ -120,8 +120,14 @@ class WebDocument : public WebNode {
// Gets the accessibility object that has focus.
BLINK_EXPORT WebAXObject FocusedAccessibilityObject() const;
- // Inserts the given CSS source code as a stylesheet in the document.
- BLINK_EXPORT void InsertStyleSheet(const WebString& source_code);
+ // Inserts the given CSS source code as a stylesheet in the document, and
+ // return its id.
+ BLINK_EXPORT int InsertStyleSheet(const WebString& source_code);
rune 2017/05/16 09:00:59 Could you use a typedef with a suitable id type na
limasdf 2017/05/18 12:32:53 Done.
+
+ // Removes the CSS which was previously inserted by a call to
+ // InsertStyleSheet(). Returns true on success. False means that there's no
+ // corresponding stylesheet.
+ BLINK_EXPORT bool RemoveInsertedStyleSheet(int id);
rune 2017/05/16 09:00:59 Is a return value necessary here?
limasdf 2017/05/18 12:32:53 I was thinking the extension api should return an
rune 2017/05/16 09:00:59 These API methods should have a unit test.
limasdf 2017/05/18 12:32:53 Done.
// Arranges to call WebFrameClient::didMatchCSS(frame(), ...) when one of
// the selectors matches or stops matching an element in this document.

Powered by Google App Engine
This is Rietveld 408576698