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

Unified Diff: chrome/browser/extensions/api/automation_internal/automation_web_contents_observer.h

Issue 1155183006: Reimplement automation API on top of C++-backed AXTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_faster_2
Patch Set: Rebase, delete some code that shouldn't have been commented out Created 5 years, 6 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: chrome/browser/extensions/api/automation_internal/automation_web_contents_observer.h
diff --git a/chrome/browser/extensions/api/automation_internal/automation_web_contents_observer.h b/chrome/browser/extensions/api/automation_internal/automation_web_contents_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..346bbf497a27bfcb65ad3420ea961f39294dd62e
--- /dev/null
+++ b/chrome/browser/extensions/api/automation_internal/automation_web_contents_observer.h
@@ -0,0 +1,39 @@
+// Copyright 2015 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_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_WEB_CONTENTS_OBSERVER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_WEB_CONTENTS_OBSERVER_H_
+
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace extensions {
+
+// Helper class that receives accessibility data from |WebContents|.
+class AutomationWebContentsObserver
+ : public content::WebContentsObserver,
+ public content::WebContentsUserData<AutomationWebContentsObserver> {
+ public:
+ ~AutomationWebContentsObserver() override {}
+
+ // content::WebContentsObserver overrides.
+ void AccessibilityEventReceived(
+ const std::vector<content::AXEventNotificationDetails>& details)
+ override;
+ void RenderFrameDeleted(
+ content::RenderFrameHost* render_frame_host) override;
+
+ private:
+ friend class content::WebContentsUserData<AutomationWebContentsObserver>;
+
+ explicit AutomationWebContentsObserver(content::WebContents* web_contents);
+
+ content::BrowserContext* browser_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutomationWebContentsObserver);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_WEB_CONTENTS_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698