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 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "content/public/browser/notification_observer.h" | 46 #include "content/public/browser/notification_observer.h" |
47 #include "content/public/browser/notification_registrar.h" | 47 #include "content/public/browser/notification_registrar.h" |
48 #include "content/public/browser/notification_types.h" | 48 #include "content/public/browser/notification_types.h" |
49 #include "extensions/common/constants.h" | 49 #include "extensions/common/constants.h" |
50 #include "ui/gfx/point.h" | 50 #include "ui/gfx/point.h" |
51 #include "ui/gfx/size.h" | 51 #include "ui/gfx/size.h" |
52 | 52 |
53 class AutomationProvider; | 53 class AutomationProvider; |
54 class BalloonCollection; | 54 class BalloonCollection; |
55 class Browser; | 55 class Browser; |
56 class ExtensionProcessManager; | |
57 class ExtensionService; | 56 class ExtensionService; |
58 class Notification; | 57 class Notification; |
59 class Profile; | 58 class Profile; |
60 class SavePackage; | 59 class SavePackage; |
61 | 60 |
62 namespace automation { | 61 namespace automation { |
63 class Error; | 62 class Error; |
64 } | 63 } |
65 | 64 |
66 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
67 namespace chromeos { | 66 namespace chromeos { |
68 class ExistingUserController; | 67 class ExistingUserController; |
69 class WizardScreen; | 68 class WizardScreen; |
70 } | 69 } |
71 #endif // defined(OS_CHROMEOS) | 70 #endif // defined(OS_CHROMEOS) |
72 | 71 |
73 namespace content { | 72 namespace content { |
74 class NavigationController; | 73 class NavigationController; |
75 class RenderViewHost; | 74 class RenderViewHost; |
76 class WebContents; | 75 class WebContents; |
77 } | 76 } |
78 | 77 |
79 namespace extensions { | 78 namespace extensions { |
80 class Extension; | 79 class Extension; |
| 80 class ProcessManager; |
81 } | 81 } |
82 | 82 |
83 namespace history { | 83 namespace history { |
84 class TopSites; | 84 class TopSites; |
85 } | 85 } |
86 | 86 |
87 namespace IPC { | 87 namespace IPC { |
88 class Message; | 88 class Message; |
89 } | 89 } |
90 | 90 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallObserver); | 341 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallObserver); |
342 }; | 342 }; |
343 | 343 |
344 // Observes when an extension has finished loading and is ready for use. Also | 344 // Observes when an extension has finished loading and is ready for use. Also |
345 // checks for possible install errors. | 345 // checks for possible install errors. |
346 class ExtensionReadyNotificationObserver | 346 class ExtensionReadyNotificationObserver |
347 : public content::NotificationObserver { | 347 : public content::NotificationObserver { |
348 public: | 348 public: |
349 // Creates an observer that replies using the JSON automation interface. | 349 // Creates an observer that replies using the JSON automation interface. |
350 ExtensionReadyNotificationObserver(ExtensionProcessManager* manager, | 350 ExtensionReadyNotificationObserver(extensions::ProcessManager* manager, |
351 ExtensionService* service, | 351 ExtensionService* service, |
352 AutomationProvider* automation, | 352 AutomationProvider* automation, |
353 IPC::Message* reply_message); | 353 IPC::Message* reply_message); |
354 virtual ~ExtensionReadyNotificationObserver(); | 354 virtual ~ExtensionReadyNotificationObserver(); |
355 | 355 |
356 // Overridden from content::NotificationObserver: | 356 // Overridden from content::NotificationObserver: |
357 virtual void Observe(int type, | 357 virtual void Observe(int type, |
358 const content::NotificationSource& source, | 358 const content::NotificationSource& source, |
359 const content::NotificationDetails& details) OVERRIDE; | 359 const content::NotificationDetails& details) OVERRIDE; |
360 | 360 |
361 private: | 361 private: |
362 void Init(); | 362 void Init(); |
363 | 363 |
364 content::NotificationRegistrar registrar_; | 364 content::NotificationRegistrar registrar_; |
365 ExtensionProcessManager* manager_; | 365 extensions::ProcessManager* manager_; |
366 ExtensionService* service_; | 366 ExtensionService* service_; |
367 base::WeakPtr<AutomationProvider> automation_; | 367 base::WeakPtr<AutomationProvider> automation_; |
368 scoped_ptr<IPC::Message> reply_message_; | 368 scoped_ptr<IPC::Message> reply_message_; |
369 const extensions::Extension* extension_; | 369 const extensions::Extension* extension_; |
370 | 370 |
371 DISALLOW_COPY_AND_ASSIGN(ExtensionReadyNotificationObserver); | 371 DISALLOW_COPY_AND_ASSIGN(ExtensionReadyNotificationObserver); |
372 }; | 372 }; |
373 | 373 |
374 class ExtensionUnloadNotificationObserver | 374 class ExtensionUnloadNotificationObserver |
375 : public content::NotificationObserver { | 375 : public content::NotificationObserver { |
(...skipping 16 matching lines...) Expand all Loading... |
392 | 392 |
393 DISALLOW_COPY_AND_ASSIGN(ExtensionUnloadNotificationObserver); | 393 DISALLOW_COPY_AND_ASSIGN(ExtensionUnloadNotificationObserver); |
394 }; | 394 }; |
395 | 395 |
396 // Observes when the extensions have been fully updated. The ExtensionUpdater | 396 // Observes when the extensions have been fully updated. The ExtensionUpdater |
397 // service provides a notification whem all the updated extensions have been | 397 // service provides a notification whem all the updated extensions have been |
398 // installed, but it does not wait for all of them to be loaded too. This | 398 // installed, but it does not wait for all of them to be loaded too. This |
399 // observer waits until all updated extensions have actually been loaded. | 399 // observer waits until all updated extensions have actually been loaded. |
400 class ExtensionsUpdatedObserver : public content::NotificationObserver { | 400 class ExtensionsUpdatedObserver : public content::NotificationObserver { |
401 public: | 401 public: |
402 ExtensionsUpdatedObserver(ExtensionProcessManager* manager, | 402 ExtensionsUpdatedObserver(extensions::ProcessManager* manager, |
403 AutomationProvider* automation, | 403 AutomationProvider* automation, |
404 IPC::Message* reply_message); | 404 IPC::Message* reply_message); |
405 virtual ~ExtensionsUpdatedObserver(); | 405 virtual ~ExtensionsUpdatedObserver(); |
406 | 406 |
407 // Overridden from content::NotificationObserver: | 407 // Overridden from content::NotificationObserver: |
408 virtual void Observe(int type, | 408 virtual void Observe(int type, |
409 const content::NotificationSource& source, | 409 const content::NotificationSource& source, |
410 const content::NotificationDetails& details) OVERRIDE; | 410 const content::NotificationDetails& details) OVERRIDE; |
411 | 411 |
412 // Called by ExtensionUpdater when it has finished updating extensions. | 412 // Called by ExtensionUpdater when it has finished updating extensions. |
413 void UpdateCheckFinished(); | 413 void UpdateCheckFinished(); |
414 | 414 |
415 private: | 415 private: |
416 void MaybeReply(); | 416 void MaybeReply(); |
417 | 417 |
418 content::NotificationRegistrar registrar_; | 418 content::NotificationRegistrar registrar_; |
419 ExtensionProcessManager* manager_; | 419 extensions::ProcessManager* manager_; |
420 base::WeakPtr<AutomationProvider> automation_; | 420 base::WeakPtr<AutomationProvider> automation_; |
421 scoped_ptr<IPC::Message> reply_message_; | 421 scoped_ptr<IPC::Message> reply_message_; |
422 bool updater_finished_; | 422 bool updater_finished_; |
423 | 423 |
424 DISALLOW_COPY_AND_ASSIGN(ExtensionsUpdatedObserver); | 424 DISALLOW_COPY_AND_ASSIGN(ExtensionsUpdatedObserver); |
425 }; | 425 }; |
426 | 426 |
427 // Observes when a new browser has been opened and a tab within it has stopped | 427 // Observes when a new browser has been opened and a tab within it has stopped |
428 // loading. | 428 // loading. |
429 class BrowserOpenedNotificationObserver : public content::NotificationObserver { | 429 class BrowserOpenedNotificationObserver : public content::NotificationObserver { |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 base::WeakPtr<AutomationProvider> automation_; | 1479 base::WeakPtr<AutomationProvider> automation_; |
1480 scoped_ptr<IPC::Message> reply_message_; | 1480 scoped_ptr<IPC::Message> reply_message_; |
1481 int new_window_id_; | 1481 int new_window_id_; |
1482 int num_loads_; | 1482 int num_loads_; |
1483 | 1483 |
1484 DISALLOW_COPY_AND_ASSIGN( | 1484 DISALLOW_COPY_AND_ASSIGN( |
1485 BrowserOpenedWithExistingProfileNotificationObserver); | 1485 BrowserOpenedWithExistingProfileNotificationObserver); |
1486 }; | 1486 }; |
1487 | 1487 |
1488 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1488 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
OLD | NEW |