| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 public: | 594 public: |
| 595 DomOperationObserver(); | 595 DomOperationObserver(); |
| 596 virtual ~DomOperationObserver(); | 596 virtual ~DomOperationObserver(); |
| 597 | 597 |
| 598 virtual void Observe(int type, | 598 virtual void Observe(int type, |
| 599 const content::NotificationSource& source, | 599 const content::NotificationSource& source, |
| 600 const content::NotificationDetails& details) OVERRIDE; | 600 const content::NotificationDetails& details) OVERRIDE; |
| 601 | 601 |
| 602 virtual void OnDomOperationCompleted(const std::string& json) = 0; | 602 virtual void OnDomOperationCompleted(const std::string& json) = 0; |
| 603 virtual void OnModalDialogShown() = 0; | 603 virtual void OnModalDialogShown() = 0; |
| 604 virtual void OnJavascriptBlocked() = 0; |
| 604 | 605 |
| 605 private: | 606 private: |
| 606 content::NotificationRegistrar registrar_; | 607 content::NotificationRegistrar registrar_; |
| 607 | 608 |
| 608 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver); | 609 DISALLOW_COPY_AND_ASSIGN(DomOperationObserver); |
| 609 }; | 610 }; |
| 610 | 611 |
| 611 // Sends a message back to the automation client with the results of the DOM | 612 // Sends a message back to the automation client with the results of the DOM |
| 612 // operation. | 613 // operation. |
| 613 class DomOperationMessageSender : public DomOperationObserver { | 614 class DomOperationMessageSender : public DomOperationObserver { |
| 614 public: | 615 public: |
| 615 DomOperationMessageSender(AutomationProvider* automation, | 616 DomOperationMessageSender(AutomationProvider* automation, |
| 616 IPC::Message* relpy_message, | 617 IPC::Message* relpy_message, |
| 617 bool use_json_interface); | 618 bool use_json_interface); |
| 618 virtual ~DomOperationMessageSender(); | 619 virtual ~DomOperationMessageSender(); |
| 619 | 620 |
| 620 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; | 621 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; |
| 621 virtual void OnModalDialogShown() OVERRIDE; | 622 virtual void OnModalDialogShown() OVERRIDE; |
| 623 virtual void OnJavascriptBlocked() OVERRIDE; |
| 622 | 624 |
| 623 private: | 625 private: |
| 624 base::WeakPtr<AutomationProvider> automation_; | 626 base::WeakPtr<AutomationProvider> automation_; |
| 625 scoped_ptr<IPC::Message> reply_message_; | 627 scoped_ptr<IPC::Message> reply_message_; |
| 626 bool use_json_interface_; | 628 bool use_json_interface_; |
| 627 | 629 |
| 628 DISALLOW_COPY_AND_ASSIGN(DomOperationMessageSender); | 630 DISALLOW_COPY_AND_ASSIGN(DomOperationMessageSender); |
| 629 }; | 631 }; |
| 630 | 632 |
| 631 class DocumentPrintedNotificationObserver | 633 class DocumentPrintedNotificationObserver |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 private: | 1807 private: |
| 1806 content::NotificationRegistrar registrar_; | 1808 content::NotificationRegistrar registrar_; |
| 1807 base::WeakPtr<AutomationProvider> automation_; | 1809 base::WeakPtr<AutomationProvider> automation_; |
| 1808 scoped_ptr<IPC::Message> reply_message_; | 1810 scoped_ptr<IPC::Message> reply_message_; |
| 1809 int new_window_id_; | 1811 int new_window_id_; |
| 1810 | 1812 |
| 1811 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); | 1813 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); |
| 1812 }; | 1814 }; |
| 1813 | 1815 |
| 1814 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1816 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |