OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 int active_match_ordinal_; | 601 int active_match_ordinal_; |
602 // Send reply using json automation interface. | 602 // Send reply using json automation interface. |
603 bool reply_with_json_; | 603 bool reply_with_json_; |
604 scoped_ptr<IPC::Message> reply_message_; | 604 scoped_ptr<IPC::Message> reply_message_; |
605 | 605 |
606 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver); | 606 DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver); |
607 }; | 607 }; |
608 | 608 |
609 class DomOperationObserver : public content::NotificationObserver { | 609 class DomOperationObserver : public content::NotificationObserver { |
610 public: | 610 public: |
611 DomOperationObserver(); | 611 explicit DomOperationObserver(int automation_id); |
612 virtual ~DomOperationObserver(); | 612 virtual ~DomOperationObserver(); |
613 | 613 |
614 virtual void Observe(int type, | 614 virtual void Observe(int type, |
615 const content::NotificationSource& source, | 615 const content::NotificationSource& source, |
616 const content::NotificationDetails& details) OVERRIDE; | 616 const content::NotificationDetails& details) OVERRIDE; |
617 | 617 |
618 virtual void OnDomOperationCompleted(const std::string& json) = 0; | 618 virtual void OnDomOperationCompleted(const std::string& json) = 0; |
619 virtual void OnModalDialogShown() = 0; | 619 virtual void OnModalDialogShown() = 0; |
620 virtual void OnJavascriptBlocked() = 0; | 620 virtual void OnJavascriptBlocked() = 0; |
621 | 621 |
622 private: | 622 private: |
| 623 int automation_id_; |
623 content::NotificationRegistrar registrar_; | 624 content::NotificationRegistrar registrar_; |
624 | 625 |
625 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver); | 626 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver); |
626 }; | 627 }; |
627 | 628 |
628 // Sends a message back to the automation client with the results of the DOM | 629 // Sends a message back to the automation client with the results of the DOM |
629 // operation. | 630 // operation. |
630 class DomOperationMessageSender : public DomOperationObserver { | 631 class DomOperationMessageSender : public DomOperationObserver { |
631 public: | 632 public: |
632 DomOperationMessageSender(AutomationProvider* automation, | 633 DomOperationMessageSender(AutomationProvider* automation, |
633 IPC::Message* relpy_message, | 634 IPC::Message* reply_message, |
634 bool use_json_interface); | 635 bool use_json_interface); |
635 virtual ~DomOperationMessageSender(); | 636 virtual ~DomOperationMessageSender(); |
636 | 637 |
637 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; | 638 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; |
638 virtual void OnModalDialogShown() OVERRIDE; | 639 virtual void OnModalDialogShown() OVERRIDE; |
639 virtual void OnJavascriptBlocked() OVERRIDE; | 640 virtual void OnJavascriptBlocked() OVERRIDE; |
640 | 641 |
641 private: | 642 private: |
642 base::WeakPtr<AutomationProvider> automation_; | 643 base::WeakPtr<AutomationProvider> automation_; |
643 scoped_ptr<IPC::Message> reply_message_; | 644 scoped_ptr<IPC::Message> reply_message_; |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 private: | 1888 private: |
1888 base::WeakPtr<AutomationProvider> automation_; | 1889 base::WeakPtr<AutomationProvider> automation_; |
1889 scoped_ptr<IPC::Message> reply_message_; | 1890 scoped_ptr<IPC::Message> reply_message_; |
1890 std::string extension_id_; | 1891 std::string extension_id_; |
1891 content::NotificationRegistrar registrar_; | 1892 content::NotificationRegistrar registrar_; |
1892 | 1893 |
1893 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); | 1894 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); |
1894 }; | 1895 }; |
1895 | 1896 |
1896 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1897 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
OLD | NEW |