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