| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 virtual void OnJavascriptBlocked() OVERRIDE; | 639 virtual void OnJavascriptBlocked() OVERRIDE; |
| 640 | 640 |
| 641 private: | 641 private: |
| 642 base::WeakPtr<AutomationProvider> automation_; | 642 base::WeakPtr<AutomationProvider> automation_; |
| 643 scoped_ptr<IPC::Message> reply_message_; | 643 scoped_ptr<IPC::Message> reply_message_; |
| 644 bool use_json_interface_; | 644 bool use_json_interface_; |
| 645 | 645 |
| 646 DISALLOW_COPY_AND_ASSIGN(DomOperationMessageSender); | 646 DISALLOW_COPY_AND_ASSIGN(DomOperationMessageSender); |
| 647 }; | 647 }; |
| 648 | 648 |
| 649 class DocumentPrintedNotificationObserver | |
| 650 : public content::NotificationObserver { | |
| 651 public: | |
| 652 DocumentPrintedNotificationObserver(AutomationProvider* automation, | |
| 653 IPC::Message* reply_message); | |
| 654 virtual ~DocumentPrintedNotificationObserver(); | |
| 655 | |
| 656 virtual void Observe(int type, const content::NotificationSource& source, | |
| 657 const content::NotificationDetails& details); | |
| 658 | |
| 659 private: | |
| 660 content::NotificationRegistrar registrar_; | |
| 661 base::WeakPtr<AutomationProvider> automation_; | |
| 662 bool success_; | |
| 663 scoped_ptr<IPC::Message> reply_message_; | |
| 664 | |
| 665 DISALLOW_COPY_AND_ASSIGN(DocumentPrintedNotificationObserver); | |
| 666 }; | |
| 667 | |
| 668 // Collects METRIC_EVENT_DURATION notifications and keep track of the times. | 649 // Collects METRIC_EVENT_DURATION notifications and keep track of the times. |
| 669 class MetricEventDurationObserver : public content::NotificationObserver { | 650 class MetricEventDurationObserver : public content::NotificationObserver { |
| 670 public: | 651 public: |
| 671 MetricEventDurationObserver(); | 652 MetricEventDurationObserver(); |
| 672 virtual ~MetricEventDurationObserver(); | 653 virtual ~MetricEventDurationObserver(); |
| 673 | 654 |
| 674 // Get the duration of an event. Returns -1 if we haven't seen the event. | 655 // Get the duration of an event. Returns -1 if we haven't seen the event. |
| 675 int GetEventDurationMs(const std::string& event_name); | 656 int GetEventDurationMs(const std::string& event_name); |
| 676 | 657 |
| 677 // NotificationObserver interface. | 658 // NotificationObserver interface. |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 private: | 1887 private: |
| 1907 base::WeakPtr<AutomationProvider> automation_; | 1888 base::WeakPtr<AutomationProvider> automation_; |
| 1908 scoped_ptr<IPC::Message> reply_message_; | 1889 scoped_ptr<IPC::Message> reply_message_; |
| 1909 std::string extension_id_; | 1890 std::string extension_id_; |
| 1910 content::NotificationRegistrar registrar_; | 1891 content::NotificationRegistrar registrar_; |
| 1911 | 1892 |
| 1912 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); | 1893 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); |
| 1913 }; | 1894 }; |
| 1914 | 1895 |
| 1915 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1896 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |