| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 const FilePath& path); | 1355 const FilePath& path); |
| 1354 virtual ~PageSnapshotTaker(); | 1356 virtual ~PageSnapshotTaker(); |
| 1355 | 1357 |
| 1356 // Start the process of taking a snapshot of the entire page. | 1358 // Start the process of taking a snapshot of the entire page. |
| 1357 void Start(); | 1359 void Start(); |
| 1358 | 1360 |
| 1359 private: | 1361 private: |
| 1360 // Overriden from DomOperationObserver. | 1362 // Overriden from DomOperationObserver. |
| 1361 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; | 1363 virtual void OnDomOperationCompleted(const std::string& json) OVERRIDE; |
| 1362 virtual void OnModalDialogShown() OVERRIDE; | 1364 virtual void OnModalDialogShown() OVERRIDE; |
| 1365 virtual void OnJavascriptBlocked() OVERRIDE; |
| 1363 | 1366 |
| 1364 // Called by the ThumbnailGenerator when the requested snapshot has been | 1367 // Called by the ThumbnailGenerator when the requested snapshot has been |
| 1365 // generated. | 1368 // generated. |
| 1366 void OnSnapshotTaken(const SkBitmap& bitmap); | 1369 void OnSnapshotTaken(const SkBitmap& bitmap); |
| 1367 | 1370 |
| 1368 // Helper method to send arbitrary javascript to the renderer for evaluation. | 1371 // Helper method to send arbitrary javascript to the renderer for evaluation. |
| 1369 void ExecuteScript(const std::wstring& javascript); | 1372 void ExecuteScript(const std::wstring& javascript); |
| 1370 | 1373 |
| 1371 // Helper method to send a response back to the client. Deletes this. | 1374 // Helper method to send a response back to the client. Deletes this. |
| 1372 void SendMessage(bool success, const std::string& error_msg); | 1375 void SendMessage(bool success, const std::string& error_msg); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 private: | 1807 private: |
| 1805 content::NotificationRegistrar registrar_; | 1808 content::NotificationRegistrar registrar_; |
| 1806 base::WeakPtr<AutomationProvider> automation_; | 1809 base::WeakPtr<AutomationProvider> automation_; |
| 1807 scoped_ptr<IPC::Message> reply_message_; | 1810 scoped_ptr<IPC::Message> reply_message_; |
| 1808 int new_window_id_; | 1811 int new_window_id_; |
| 1809 | 1812 |
| 1810 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); | 1813 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); |
| 1811 }; | 1814 }; |
| 1812 | 1815 |
| 1813 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1816 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |