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

Unified Diff: chrome/renderer/extensions/content_watcher.h

Issue 235943018: Move extensions bindings code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 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 | « chrome/renderer/extensions/blob_native_handler.cc ('k') | chrome/renderer/extensions/content_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/content_watcher.h
diff --git a/chrome/renderer/extensions/content_watcher.h b/chrome/renderer/extensions/content_watcher.h
deleted file mode 100644
index 8eb2289f05fd27eb792ba85855e8f92922526027..0000000000000000000000000000000000000000
--- a/chrome/renderer/extensions/content_watcher.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_RENDERER_EXTENSIONS_CONTENT_WATCHER_H_
-#define CHROME_RENDERER_EXTENSIONS_CONTENT_WATCHER_H_
-
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-
-#include "third_party/WebKit/public/platform/WebVector.h"
-
-namespace blink {
-class WebFrame;
-class WebString;
-}
-
-namespace extensions {
-class Dispatcher;
-class Extension;
-class NativeHandler;
-
-// Watches the content of WebFrames to notify extensions when they match various
-// patterns. This class tracks the set of relevant patterns (set by
-// ExtensionMsg_WatchPages) and the set that match on each WebFrame, and sends a
-// ExtensionHostMsg_OnWatchedPageChange whenever a RenderView's set changes.
-//
-// There's one ContentWatcher per Dispatcher rather than per RenderView because
-// WebFrames can move between RenderViews through adoptNode.
-class ContentWatcher {
- public:
- ContentWatcher();
- ~ContentWatcher();
-
- // Handler for ExtensionMsg_WatchPages.
- void OnWatchPages(const std::vector<std::string>& css_selectors);
-
- // Uses WebDocument::watchCSSSelectors to watch the selectors in
- // css_selectors_ and get a callback into DidMatchCSS() whenever the set of
- // matching selectors in |frame| changes.
- void DidCreateDocumentElement(blink::WebFrame* frame);
-
- // Records that |newly_matching_selectors| have started matching on |*frame|,
- // and |stopped_matching_selectors| have stopped matching.
- void DidMatchCSS(
- blink::WebFrame* frame,
- const blink::WebVector<blink::WebString>& newly_matching_selectors,
- const blink::WebVector<blink::WebString>& stopped_matching_selectors);
-
- private:
- // Given that we saw a change in the CSS selectors that |changed_frame|
- // matched, tell the browser about the new set of matching selectors in its
- // top-level page. We filter this so that if an extension were to be granted
- // activeTab permission on that top-level page, we only send CSS selectors for
- // frames that it could run on.
- void NotifyBrowserOfChange(blink::WebFrame* changed_frame) const;
-
- // If any of these selectors match on a page, we need to send an
- // ExtensionHostMsg_OnWatchedPageChange back to the browser.
- blink::WebVector<blink::WebString> css_selectors_;
-
- // Maps live WebFrames to the set of CSS selectors they match. Blink sends
- // back diffs, which we apply to these sets.
- std::map<blink::WebFrame*, std::set<std::string> > matching_selectors_;
-};
-
-} // namespace extensions
-
-#endif // CHROME_RENDERER_EXTENSIONS_CONTENT_WATCHER_H_
« no previous file with comments | « chrome/renderer/extensions/blob_native_handler.cc ('k') | chrome/renderer/extensions/content_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698