| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 std::string id_; | 328 std::string id_; |
| 329 | 329 |
| 330 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallObserver); | 330 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallObserver); |
| 331 }; | 331 }; |
| 332 | 332 |
| 333 // Observes when an extension has finished loading and is ready for use. Also | 333 // Observes when an extension has finished loading and is ready for use. Also |
| 334 // checks for possible install errors. | 334 // checks for possible install errors. |
| 335 class ExtensionReadyNotificationObserver | 335 class ExtensionReadyNotificationObserver |
| 336 : public content::NotificationObserver { | 336 : public content::NotificationObserver { |
| 337 public: | 337 public: |
| 338 // Creates an observer that replies using the old IPC automation method. |
| 338 ExtensionReadyNotificationObserver(ExtensionProcessManager* manager, | 339 ExtensionReadyNotificationObserver(ExtensionProcessManager* manager, |
| 339 ExtensionService* service, | 340 ExtensionService* service, |
| 340 AutomationProvider* automation, | 341 AutomationProvider* automation, |
| 341 int id, | 342 int id, |
| 342 IPC::Message* reply_message); | 343 IPC::Message* reply_message); |
| 344 // Creates an observer that replies using the JSON automation interface. |
| 345 ExtensionReadyNotificationObserver(ExtensionProcessManager* manager, |
| 346 ExtensionService* service, |
| 347 AutomationProvider* automation, |
| 348 IPC::Message* reply_message); |
| 343 virtual ~ExtensionReadyNotificationObserver(); | 349 virtual ~ExtensionReadyNotificationObserver(); |
| 344 | 350 |
| 345 // Implementation of NotificationObserver. | 351 // Implementation of NotificationObserver. |
| 346 virtual void Observe(int type, | 352 virtual void Observe(int type, |
| 347 const content::NotificationSource& source, | 353 const content::NotificationSource& source, |
| 348 const content::NotificationDetails& details); | 354 const content::NotificationDetails& details); |
| 349 | 355 |
| 350 private: | 356 private: |
| 357 void Init(); |
| 358 |
| 351 content::NotificationRegistrar registrar_; | 359 content::NotificationRegistrar registrar_; |
| 352 ExtensionProcessManager* manager_; | 360 ExtensionProcessManager* manager_; |
| 353 ExtensionService* service_; | 361 ExtensionService* service_; |
| 354 base::WeakPtr<AutomationProvider> automation_; | 362 base::WeakPtr<AutomationProvider> automation_; |
| 355 int id_; | 363 int id_; |
| 356 scoped_ptr<IPC::Message> reply_message_; | 364 scoped_ptr<IPC::Message> reply_message_; |
| 365 bool use_json_; |
| 357 const Extension* extension_; | 366 const Extension* extension_; |
| 358 | 367 |
| 359 DISALLOW_COPY_AND_ASSIGN(ExtensionReadyNotificationObserver); | 368 DISALLOW_COPY_AND_ASSIGN(ExtensionReadyNotificationObserver); |
| 360 }; | 369 }; |
| 361 | 370 |
| 362 class ExtensionUnloadNotificationObserver | 371 class ExtensionUnloadNotificationObserver |
| 363 : public content::NotificationObserver { | 372 : public content::NotificationObserver { |
| 364 public: | 373 public: |
| 365 ExtensionUnloadNotificationObserver(); | 374 ExtensionUnloadNotificationObserver(); |
| 366 virtual ~ExtensionUnloadNotificationObserver(); | 375 virtual ~ExtensionUnloadNotificationObserver(); |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 private: | 1814 private: |
| 1806 content::NotificationRegistrar registrar_; | 1815 content::NotificationRegistrar registrar_; |
| 1807 base::WeakPtr<AutomationProvider> automation_; | 1816 base::WeakPtr<AutomationProvider> automation_; |
| 1808 scoped_ptr<IPC::Message> reply_message_; | 1817 scoped_ptr<IPC::Message> reply_message_; |
| 1809 int new_window_id_; | 1818 int new_window_id_; |
| 1810 | 1819 |
| 1811 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); | 1820 DISALLOW_COPY_AND_ASSIGN(BrowserOpenedWithNewProfileNotificationObserver); |
| 1812 }; | 1821 }; |
| 1813 | 1822 |
| 1814 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1823 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |